Consulting

Results 1 to 4 of 4

Thread: Getting a handle on internet explorer instance

  1. #1
    VBAX Mentor
    Joined
    Oct 2007
    Posts
    357
    Location

    Question Getting a handle on internet explorer instance


    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.

    Regards
    Sudhir

  2. #2
    VBAX Tutor mohanvijay's Avatar
    Joined
    Aug 2010
    Location
    MADURAI
    Posts
    268
    Location
    try this

    [vba]
    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
    [/vba]

  3. #3
    VBAX Mentor
    Joined
    Oct 2007
    Posts
    357
    Location
    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

  4. #4
    VBAX Master Aflatoon's Avatar
    Joined
    Sep 2009
    Location
    UK
    Posts
    1,720
    Location
    You need a reference to Microsoft Internet Controls
    Be as you wish to seem

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •