klee540
12-05-2009, 08:41 AM
I have an Office 2007 VBA module that uses the MS IE control to open and read from a local html file. This module has worked fine with IE6 & IE7. In IE8, it causes an "Automation Error". It appears the problem has something to do with the opening of a local html file. When I change the code to navigate to an external URL, it runs fine.
Here's the problem module:
Dim ie As InternetExplorer
Dim doc As HTMLDocument
Dim bod As HTMLBody
Set ie = New InternetExplorer
ie.Visible = True
ie.Navigate "D:\LocalFile.html"
Do Until ie.Busy = False And ie.readyState = 4
DoEvents
Loop
Set doc = ie.Document
ie.Quit
Set ie = Nothing
All help & suggestions are greatly appreciated. Thanks in advance,
-Kenneth
Here's the problem module:
Dim ie As InternetExplorer
Dim doc As HTMLDocument
Dim bod As HTMLBody
Set ie = New InternetExplorer
ie.Visible = True
ie.Navigate "D:\LocalFile.html"
Do Until ie.Busy = False And ie.readyState = 4
DoEvents
Loop
Set doc = ie.Document
ie.Quit
Set ie = Nothing
All help & suggestions are greatly appreciated. Thanks in advance,
-Kenneth