• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

VBA to click image login button on web page

gmmdinesh

New Member
Hi
I have a code to Automatic log in a website..the website having Image login button.
The problem is this code does not click that login button.
Anyone knows how to click on this type of image button.


VBA Code
Code:
Sub Auto_login()
    Set IE = CreateObject("InternetExplorer.Application")
      my_url = "https://sapitsp.tsjl.com/sap/bc/gui/sap/its/catw?sap-language=EN"
    With IE
        .Visible = True
        .Navigate my_url
            Do Until Not IE.Busy And IE.ReadyState = 4
        DoEvents
    Loop
    End With
IE.Document.getElementById("sap-user").Value = Sheets("Portal").Range("B21").Value
    IE.Document.getElementById("sap-password").Value = Sheets("Portal").Range("B22").Value
For Each MyHTML_Element In Document.getElementsByTagName("callsubmitlogin")
If MyHTML_Element.Type = "image" Then
MyHTML_Element.Click: Exit For
End If
Next
    Do Until Not IE.Busy And IE.ReadyState = 4
        DoEvents
    Loop


    End Sub

HTML Code
HTML:
<INPUT onclick="callSubmitLogin(' me->co_event_login '); return false;" src="/sap/public/bc/its/mimes/ess_global/99/EN/images/buttons/login.gif" type=image value=Logon>

Thanks in Advance
 
Back
Top