PDA

View Full Version : InternetExplorer.Navigate disconnects in Windows 7?



ernmeg
09-03-2009, 12:44 PM
Hello,
We've got an existing Word macro that navigates to a URL in IE and grabs the html that is returned. This works fine in Word 2000, 2003, 2007 on Win 2k, XP and Vista, but with the upcoming release of Windows 7, we've discovered that this functionality is not working.

Upon testing, the following code works FINE on all other environments, when when I run it on Windows 7 with Office 2007, it fails on the Do While oIE.busy call. The error is "Automation Error: The object invoked has disconnected from its clients".

I can see that it opens IE and successfully navigates to the site, so it seems to me that in spite of the fact that the object is open, it can no longer communicate with IE.

I've been searching and playing with different solutions (specifically ShDocVw) but I can't get anything to reliably run in the Win7/Office2007 environment.

I appreciate any help/advice!!

ernmeg
09-03-2009, 12:45 PM
Here's the code - it wouldn't let me post it in the original message:

Sub TestIE()
Set oIE = CreateObject("InternetExplorer.Application")

oIE.Navigate "[site HERE]", , , bFormData, "Content-Type: multipart/form-data; boundary=" + strBoundary + vbCrLf

Do While oIE.busy
DoEvents
Loop

While oIE.ReadyState < 4 'READYSTATE_COMPLETE
DoEvents
Wend

Dim strRetText
strRetText = oIE.Document.Body.InnerText
MsgBox strRetText
oIE.quit

End Sub