Results 1 to 2 of 2

Thread: Very hard question. Unanswered for>5days?

  1. #1

    Thread Starter
    New Member
    Join Date
    Aug 2000
    Location
    KL, Malaysia
    Posts
    7
    I need to use GetObject so that I can detect the current IE instance which is already open by the user, save the page and go back to the previous page, put password etc. But my prog can't detect IE instance even though it is running(already open).
    The key question here is how do I detect IE instances using GetObject? Thank you.

    [code]
    Sub DetectIE()
    Dim MyIE As Object

    On Error GoTo NoIE
    Set MyIE = GetObject(, "InternetExplorer.Application")
    MsgBox "IE found"

    MyIE.Visible = True
    MyIE.Navigate "https://www.tm.net.my"
    Do Until MyIE.ReadyState = READYSTATE_COMPLETE
    DoEvents
    Loop

    'Put login name and password
    'Call Authenticate
    Do Until MyIE.ReadyState = READYSTATE_COMPLETE
    DoEvents
    Loop
    'Copy something to the homepage from Excel
    'Call CopyAllAtOnce

    Exit Sub

    NoIE:
    MsgBox "IE not found"

    End Sub
    arif

  2. #2
    Junior Member
    Join Date
    Nov 1999
    Location
    Forsyth, GA, USA
    Posts
    26
    GetObject will create a new instance of IE. If you want to access an existing instance you could use the Windows API to get the window class of IE, get a reference to the instance using the Window class, and use SendKeys (or an API call) to manipulate the window.
    Brad
    Contract Developer

Posting Permissions

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



Click Here to Expand Forum to Full Width