Hi Everyone
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
HTML code
Thanks in advance
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:
[/COLOR]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[COLOR=#333333]
HTML code
Code:
[/COLOR]<form name="loginForm" action="/sap/bc/gui/sap/its/catw" method="post"> <table border="0"> <tbody><tr height="30"><td> </td></tr> <tr><td width="100"></td> <td class="blueBold" align="right">SAP User ID: </td> <td><input type="text" id="sap-user" name="sap-user" tabindex="1" size="12" maxlength="12"></td> <td width="20"> </td> </tr> <tr><td> <input name="~logininput" type="hidden" value="1"> </td></tr> <tr><td width="100"></td> <td class="blueBold" align="right">Password: </td> <td><input type="password" id="sap-password" name="sap-password" tabindex="2" size="8" maxlength="8"></td> <td></td><td width="130"> </td> </tr> <tr><td> <input name="~passwdinput" type="hidden" value="1"> </td></tr> <tr><td> </td> <td class="BlueBold" align="right" colspan="5" wrap=""></td> </tr> </tbody></table> <table border="0"> <tbody><tr><td> <input type="image" src="/sap/public/bc/its/mimes/ess_global/99/EN/images/buttons/login.gif" value="Logon" *******="callSubmitLogin(' me->co_event_login '); return false;"> </td> <td> <a href="sapbcguisapits/zse_respwd/!?sap-language=EN" target="_blank"> <img src="/sap/public/bc/its/mimes/ess_global/99/EN/images/buttons/forgotpw.gif" border="0" tabindex="3"> </a> </td> </tr> </tbody></table> <table border="0" width="95%"> <tbody><tr><td height="10"> </td></tr> <tr><td class="infoBlack">For information about Time Management and time codes, refer to: <font color="#49166D"><b></b> <a href="http://habitat.tsl.telus.com/telusEmployeePortal/content/en/iep/human_resources/site/human_resources/hr_categories/time_off_and_vacation/time_administration/anchor_content_000376.xhtml" target="_blank">myHR >Attendance & Time Off > Time Management Help and Information </a></font>.</td></tr> <tr><td class="infoBlack">For technical difficulties, SAP user id or password problems, please contact the SPOC help desk at<font color="#49166D"><strong>1-877-600-7762</strong></font>. </td></tr> <tr><td height="5"> </td></tr> <tr> <td class="infoBlack">Some areas within TELUS have been directed to enter their time via the SAP web entry tool, however additional areas within TELUS will be added in future phases. If you receive the error message "You have no authorization for Transaction CATW", please confirm with your manager if you are to be using this tool. If yes, please ask your manager to fill out the <a href="https://cadmus.tsl.telus.com/cgi-bin/accreq/req/sap.cgi" target="_blank">SAP ERP Access Application Form</a> </td> </tr> </tbody></table></form>[COLOR=#333333]
Thanks in advance