My goal is to scrape data off multiple webpages on the same site into Excel. I have these pages open in tabs within IE8. I have no other IE windows open.
I have trie
Made some changes and it works now
Function GetIE() As Object
Dim ShellApp As Object, ShellWindows As Object
Dim IEObject As Object
Set ShellApp = CreateObject("Shell.Application")
Set ShellWindows = ShellApp.Windows()
Dim item As Object
On Error GoTo 0
Dim sName As String
For Each ObjWind In ShellWindows
'On Error Resume Next
If (Not ObjWind Is Nothing) Then
sName = ObjWind.Name
If sName = "Internet Explorer" Then
Set IEObject = ObjWind
Exit For 'No need to continue....
End If
End If
Next
If IEObject Is Nothing Then Set IEObject = CreateObject("InternetExplorer.Application")
Set ShellApp = Nothing
Set GetIE = IEObject
End Function