When I go to open Excel (manually), I receive the warning that my Personal.xls is already in use by "another user". This suggests there is an Excel process running. I confirm this on the Task Manager -- Excel is indeed running.
So I put together a quick sub to attempt to close it, and this procedure raises the 429 error on Set x = GetObject(, "Excel.Application")
.
Sub QuitExcel()
Dim x As Object
Set x = GetObject(, "Excel.Application")
x.Quit
End Sub
Question: Why is the GetObject
method failing?
Excel appears to be running, as indicated by the task manager and also by the alert that is displayed when I open Excel from the taskbar.
Update from comments
Jean-Francois suggests using a pathname, since the alert indicates a problem with my Personal.xls, I use that path. I am not really sure this is working, though. When I do this, I still see the Excel.EXE image in taskbar.
Sub GetExcel()
Dim x As Object
On Error Resume Next
Set x = GetObject(, "Excel.Application")
x.Quit
Exit Sub
If Err Then
Set x = GetObject("C:\Users\david_zemens\AppData\Roaming\Microsoft\Excel\XLSTART\PERSONAL.xls")
End If
On Error GoTo 0
x.Parent.Visible = True
x.Parent.Quit
End Sub