-
I'm using a gobal mouse hook, whenever there is mouse click, CaptureData () method will be called. The problem comes when i try to do something to the objIE1, i get a Runtime error '-2147417843(8001010d)' Automation Error. What did i do wrong?
Public Sub CaptureData()
Set objShellWins = New SHDocVw.ShellWindows
On Error GoTo cap
Dim objIE1 As SHDocVw.InternetExplorer
If isForegroundIE = True Then
Debug.Print "Current is IE"
For Each objIE1 In objshellwindows
'this is the code that gives mi error
Debug.Print objIE1.hwnd
Next objIE1
Exit Sub
cap:
Debug.Print Err.Number & " " & Err.Description
End If
End Sub
-
try using:
on error resume next
and seeing if it can just skip over ther error, and still work.
Seems like it might work,
-
Yes it works, thanks, but doesnt really solve my problem© I'm trying to loop through ShellWindows to check which Internet Explorer handle is equal to the foregroundWindow handle then assign objIE to it© The moment i try to do something with the objIE, i get an automation error© How can i solve this??