ashwinchopra
New Member
Hi All,
I am trying to login to a web page with the help of VBA. But the code isnt working. It take me to the web page but after that it doesnt enters the login credentials. Kindly help
Thanks in Advance
I am trying to login to a web page with the help of VBA. But the code isnt working. It take me to the web page but after that it doesnt enters the login credentials. Kindly help
Thanks in Advance
Code:
Dim HTMLDoc As HTMLDocument
Dim MyBrowser As InternetExplorer
Sub GST()
Dim MyHTML_Element As IHTMLElement
Dim MyURL As String
On Error GoTo Err_Clear
MyURL = "https://services.gst.gov.in/services/login"
Set MyBrowser = New InternetExplorer
MyBrowser.Silent = True
MyBrowser.navigate MyURL
MyBrowser.Visible = True
Do
Loop Until MyBrowser.readyState = READYSTATE_COMPLETE
Set HTMLDoc = MyBrowser.document
HTMLDoc.all.user_name.Value = "abccccc" 'Enter your email id here
HTMLDoc.all.user_pass.Value = "abcdds1" 'Enter your password here
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: