PDA

View Full Version : Getting a handle on internet explorer instance



kbsudhir
01-30-2013, 07:29 AM
Hi All,

I am creating an Internet Explorer object & navigating to a particular webpage.
Now, when I click on hyperlinks on that webpage using VBA the links open in new internet explorer instance. Now, I want to get a handle to this new instance so that I can extract data from the new internet explorer instance & then go back to my original internet explorer instance.

Please guide me on how to get this done. :dunno :dunno :dunno :dunno

Regards
Sudhir

mohanvijay
01-30-2013, 07:46 AM
try this


Dim O_IE As SHDocVw.InternetExplorer
Dim O_IES As SHDocVw.ShellWindows
Set O_IES = New SHDocVw.ShellWindows
For Each O_IE In O_IES

If O_IE.LocationURL = LINKURL Then
'do your stuff
End If
Next
Set O_IE = Nothing
Set O_IES = Nothing

kbsudhir
01-31-2013, 08:31 AM
Thanks MohanVijay for the guidance.

But I am getting below error:

Compile error:
User-Defined Type not defined.


I think I have add some reference here, can you please let me know which reference to add.

Regards
Sudhir

Aflatoon
01-31-2013, 08:41 AM
You need a reference to Microsoft Internet Controls