I'm creating an excel macro that will auto login to a website using the credentials from excel. It's working fine except the last part, in which, the website button is supposed to be executed.
Sub GoToWebsiteTest()
Dim appIE As InternetExplorerMedium
Dim objElement As Object
Dim objCollection As Object
Set appIE = New InternetExplorerMedium
sURL = "http://sbcho-appsvr/eSource/eSourceV2"
With appIE
.Navigate sURL
.Visible = True
End With
Do While appIE.Busy Or appIE.ReadyState <> 4
DoEvents
Loop
Set objCollection = appIE.Document.getElementsByTagName("input")
appIE.Document.getElementById("userId").Value = Sheets("Sheet1").Range("C3").Value
appIE.Document.getElementById("password").Value = Sheets("Sheet1").Range("C4").Value
appIE.Document.getElementByClassName("btn btn-small btn-info pull-right").Click
Set appIE = Nothing
End Sub
_____________________________________________________________________________________________
Below is the result whenever I click the “Inspect Element” of the login button:
button class="btn btn-small btn-info pull-right" ng-click="myform.$valid && logon()">Login
Can someone help me figure out how to activate the login button?
Thanks in advance.
<button class="btn btn-small btn-info pull-right" ng-click="myform.$valid && logon()">
</button>
Sub GoToWebsiteTest()
Dim appIE As InternetExplorerMedium
Dim objElement As Object
Dim objCollection As Object
Set appIE = New InternetExplorerMedium
sURL = "http://sbcho-appsvr/eSource/eSourceV2"
With appIE
.Navigate sURL
.Visible = True
End With
Do While appIE.Busy Or appIE.ReadyState <> 4
DoEvents
Loop
Set objCollection = appIE.Document.getElementsByTagName("input")
appIE.Document.getElementById("userId").Value = Sheets("Sheet1").Range("C3").Value
appIE.Document.getElementById("password").Value = Sheets("Sheet1").Range("C4").Value
appIE.Document.getElementByClassName("btn btn-small btn-info pull-right").Click
Set appIE = Nothing
End Sub
_____________________________________________________________________________________________
Below is the result whenever I click the “Inspect Element” of the login button:
button class="btn btn-small btn-info pull-right" ng-click="myform.$valid && logon()">Login
Can someone help me figure out how to activate the login button?
Thanks in advance.
<button class="btn btn-small btn-info pull-right" ng-click="myform.$valid && logon()">
</button>