Gary McMaster
Well-known Member
- Joined
- Feb 8, 2009
- Messages
- 1,977
Hi Everyone,
I was using the code below last evening with great success. While trying to continue with it today, it is failing.
The system is automatically changing my reference to shdocvw.dll to ieframe.dll. I haven't changed a thing since the last time it ran successfully. I'm getting "Automation error, the object invoked has disconnected from its clients". Anyone know what is happening?
I'm using Excel 2007 with Vista Home Premium.
Thanks for any advice.
Gary
'Microsoft Internet Controls - C:\Windows\System32\shdocvw.dll
'Microsoft HTML Object Library - C:\Windows\System32\mshtml.tlb
Dim oInetExp As InternetExplorer
Dim oDocument As HTMLDocument
Dim oLink As HTMLLinkElement
Dim oCell As Range
Set oCell = ThisWorkbook.ActiveSheet.Cells(1, 1)
Set oInetExp = New InternetExplorer
oInetExp.Visible = False
'oInetExp.Visible = True
oInetExp.navigate "http://www.yahoo.com/"
Do
If oInetExp.readyState = READYSTATE_COMPLETE Then
Exit Do
End If
Loop
Set oDocument = oInetExp.Document
For Each oLink In oDocument.links
oCell.Value = oLink
Set oCell = oCell.Offset(1, 0)
Next
oInetExp.Quit
I was using the code below last evening with great success. While trying to continue with it today, it is failing.
The system is automatically changing my reference to shdocvw.dll to ieframe.dll. I haven't changed a thing since the last time it ran successfully. I'm getting "Automation error, the object invoked has disconnected from its clients". Anyone know what is happening?
I'm using Excel 2007 with Vista Home Premium.
Thanks for any advice.
Gary
'Microsoft Internet Controls - C:\Windows\System32\shdocvw.dll
'Microsoft HTML Object Library - C:\Windows\System32\mshtml.tlb
Dim oInetExp As InternetExplorer
Dim oDocument As HTMLDocument
Dim oLink As HTMLLinkElement
Dim oCell As Range
Set oCell = ThisWorkbook.ActiveSheet.Cells(1, 1)
Set oInetExp = New InternetExplorer
oInetExp.Visible = False
'oInetExp.Visible = True
oInetExp.navigate "http://www.yahoo.com/"
Do
If oInetExp.readyState = READYSTATE_COMPLETE Then
Exit Do
End If
Loop
Set oDocument = oInetExp.Document
For Each oLink In oDocument.links
oCell.Value = oLink
Set oCell = oCell.Offset(1, 0)
Next
oInetExp.Quit