Ranjith kumar
New Member
Hello Excel ninjas,
I'm trying to login to a website automatically in chrome using VBA, I'm able to open the website but unable to enter login details, Please help me..Here is the code :
I'm trying to login to a website automatically in chrome using VBA, I'm able to open the website but unable to enter login details, Please help me..Here is the code :
Code:
Sub AutoLoginChrome()
Dim HTMLDoc As HTMLDocument
Dim MyBrowser As WebBrowser
Dim MyHTML_Element As IHTMLElement
Dim chromePath As String
On Error GoTo Err_Clear
MyURL = "https://incometaxindiaefiling.gov.in/e-Filing/UserLogin/LoginHome.html"
Set MyBrowser = New WebBrowser
MyBrowser.Silent = True
chromePath = "C:\Program Files\Google\Chrome\Application\chrome.exe"
Shell (chromePath & " -url https://incometaxindiaefiling.gov.in/e-Filing/UserLogin/LoginHome.html")
[IMG]https://mail.google.com/mail/ca/u/0/images/cleardot.gif[/IMG]
MyBrowser.Visible = True
Do
Loop Until MyBrowser.readyState = READYSTATE_COMPLETE
Set HTMLDoc = MyBrowser.document
HTMLDoc.all.Login_userName.Value = "......."
HTMLDoc.all.Login_password.Value = "........."
HTMLDoc.all.dateField.Value = "......"
For Each MyHTML_Element In HTMLDoc.getElementsByTagName("input")
If MyHTML_Element.Type = "submit" Then MyHTML_Element.Click: Exit For
Next
Err_Clear:
If Err <> 0 Then
Err.Clear
Resume Next
End If
End Sub
Last edited by a moderator: