0

Possible Duplicate:
Using an IE browser with Visual Basic

I have a website that is updated daily. I need to retrieve the information from this website daily. Instead of opening up a new browser eg new internet explorer everyday, is it possible to use an already opened internet explorer to retrieve the information.

Community
  • 1
  • 1
user1199080
  • 201
  • 2
  • 8
  • 13

1 Answers1

0

I don't have IE installed so I can't promise this will work, but give it a shot. Note that you'll need to set references to Microsoft Internet Controls and Microsoft HTML Object Library.

Function GetOpenIE() As SHDocVw.InternetExplorer

    Dim ie As SHDocVw.InternetExplorer
    Dim sw As SHDocVw.shellWindows

    Set sw = New SHDocVw.shellWindows

    For Each ie In sw
        If TypeOf ie.Document Is HTMLDocument Then
            Set GetOpenIE = ie
            Exit Function
        End If
    Next ie

End Function
mkingston
  • 2,678
  • 16
  • 26
  • 1
    why post something that you can't test (and presumably should be referenced to a source elsewhere)? Plus as per my comment above this is a duplicate question. – brettdj Mar 16 '12 at 08:02