When I open Excel (manually), I get a warning that my Personal.xls is already in use by a "different user". This indicates that the Excel process is running. I confirm this in Task Manager - Excel really works.
So, I put together a quick sub to try to close it, and this procedure causes error 429 on Set x = GetObject(, "Excel.Application").
Sub QuitExcel()
Dim x As Object
Set x = GetObject(, "Excel.Application")
x.Quit
End Sub
Question: Why GetObjectdoes the method not work?
Excel appears, as indicated by the task manager, as well as a warning that appears when you open Excel from the taskbar.
Update from comments
- , Personal.xls, . , . , Excel.EXE .
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