Runtime Error 80010108 During IE Automation

mugginsjr

New Member
Joined
Nov 29, 2011
Messages
40
Long time fan of Mr. Excel, first time poster: I just migrated to Office 2010 and have run up against a slew of problems, mostly permissions and library reference problems that you get every time you upgrade, But this one problem is not going away easily:

While automating Internet Explorer through Excel VBA I keep getting errors because the object is disconnecting itself after the instruction to navigate to any URL. It is RunTime Errer 80010108, "The object invoked has disconnected from its clients."

Here is a very simple bit of code which I have been using successfully for years in earlier versions:

Code:
Sub openIE()
    Dim ie As InternetExplorer
    Dim MyStr As String
     
    Set ie = New InternetExplorer
     
    'Search google for "VBA Excel Automation"
    ie.Navigate2 "http://www.google.com/search?q=vba+excel+automation"

[COLOR=Red]' After IE opens and navigates to the above URL it disconnects itself
' and can not be referenced as the object "ie" anymore.  the next line of 
' code that references the object will trigger the error     

' I tried using a wait command below instead of the do loop to wait for the 
' page to finish loading, but then the next reference to the object
' will trigger the error anyway..[/COLOR]


    'Loop unitl ie page is fully loaded
    Do Until ie.readyState = 4
    DoEvents
    Loop
     
    'This wait was added to isolate the exact point when the ie object was disconneecting
    Application.Wait Time + TimeSerial(0, 0, 10)
     
    'return text from google page
    MyStr = ie.document.body.innerText
    Sheet3.Range("A2") = MyStr
    Set ie = Nothing
End Sub
I don't know why this error is happening. I'm hoping someone else has seen it before and knows how to work around it. I found a few threads on that particular error itself, but none involving automation where another program was being controlled as an object.

Any help at all would be appreciated....

Thank you
John Richter
 

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.

Forum statistics

Threads
1,223,911
Messages
6,175,324
Members
452,635
Latest member
laura12345

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top