I'm Ragavan Rajan - Lead Business Improvement, Innovation & Development, having professional experience in SharePoint 2010 / SharePoint 2013, Windows 7, Windows 8, One note, VB Script, Excel and VBA.
Hi All,
I’m trying to login to a website using the macros but at the login page in the user name box I’m not able to write the user name.
can any one help
Sub search()
Dim IE As Object
Dim HTMLDoc As HTMLDocument
Dim MyHTML_Element As IHTMLElement
1 comment
Hi All,
I’m trying to login to a website using the macros but at the login page in the user name box I’m not able to write the user name.
can any one help
Sub search()
Dim IE As Object
Dim HTMLDoc As HTMLDocument
Dim MyHTML_Element As IHTMLElement
‘On Error GoTo error_handler
Application.EnableEvents = True
Set IE = CreateObject(“InternetExplorer.Application”)
With IE
.navigate “https:/#####.com/login”
IE.Visible = True
End With
Do
DoEvents
Loop Until MyBrowser.readyState = READYSTATE_COMPLETE
Set HTMLDoc = MyBrowser.document
HTMLDoc.all.userName.Value = “abcd”
HTMLDoc.all.password.Value = “1234”
If MyHTML_Element.Type = “submit” Then MyHTML_Element.Click
Exit Sub
‘error_handler:
‘MsgBox (“Unexpected Error, I’m quitting.”)
‘Set objIE = Nothing
End Sub