Ankur Kumar
New Member
Here is my coding below
I want to access a website using VBA codes by entering auto login credentials after that i want to go particular page, Please help me
I want to access a website using VBA codes by entering auto login credentials after that i want to go particular page, Please help me
Code:
Dim HTMLDoc As HTMLDocument
Dim MyBrowser As InternetExplorer
Sub Instamojo()
Dim MyHTML_Element As IHTMLElement
Dim MyURL As String
On Error GoTo Err_Clear
MyURL = "https://www.instamojo.com/accounts/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.id_login_username.Value = "ABC"
HTMLDoc.all.Password.Value = "ABC@123"
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
End If
Last edited: