GetObject(, "Excel.Application") takes forever, sometimes
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi all,
I am writing a code that needs to extract some value from excel. My code worked fine but today all in a sudden when I run it, the code started to get stucked in getobject function forever. No any error, it just seems to me that the code is running something countless times... This happened me two days ago but all in a sudden it was gone. Now it came back. What can I do? FYI, 1. CreateObject("Excel.Application") works fine, just takes so long
Dim oexcelApp As Object
On Error Resume Next
Set oexcelApp = GetObject(, "Excel.Application")
If Err Then
Err.Clear
Set oexcelApp = CreateObject("Excel.Application")
If Err Then
MsgBox "Cannot access excel."
Exit Sub
End If
End If