Results 1 to 2 of 2

Thread: GetObject InternetExplorer?

  1. #1

    Thread Starter
    New Member
    Join Date
    Aug 2000
    Location
    KL, Malaysia
    Posts
    7
    I need to use GetObject so that I can use MyIE object to navigate. My objective is to detect the current IE homepage 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.
    The key question here is how do I detect IE instances using GetObject?
    Below is a little bit detail of my 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
    Guest
    Here's your problem, you have an error, that is why you keep getting the "IE Not Found" message.

    Code:
    'Here is your error
    Set MyIE = GetObject([error is right here], "InternetExplorer.Application")
    Here is your code fixed, I don't know how to detect IE, but the code opens it no matter what.

    Code:
    Private Sub OpenIE()
    Dim MyIE As Object
    
    Set MyIE = GetObject("", "InternetExplorer.Application")
    
    
    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
    End Sub
    
    Private Sub Form_Load()
    OpenIE
    End Sub

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