Button:
I am trying to click this button with the following code.
<code>
Set Go = IE.document.getelementbyID("button-1036")
Go.Click
</code>
No dice. Here's the full code:
<code>
Private Sub CommandButton1_Click()
Dim IE As Object
Dim usr As Object
Dim pwd As Object
Dim Go As Object
Set IE = CreateObject("InternetExplorer.Application")
IE.Visible = False
'Go to this Web Page
IE.Navigate "https://eam-112.inforcloudsuite.com/web/base/logindisp?tenant=NAVISTARMFG_TRN"
'Check for good connection to web page loop
Do
If IE.ReadyState = 4 Then
IE.Visible = True
Exit Do
Else
DoEvents
End If
Loop
'Wait for window to open
Application.Wait (Now + TimeValue("0:00:01"))
IE.Visible = True
'Send logon information
Application.Wait (Now + TimeValue("0:00:01"))
Set usr = IE.document.getelementbyID("textfield-1034-inputEl")
usr.Value = "MYUSERNAME"
Set pwd = IE.document.getelementbyID("textfield-1035-inputEl")
pwd.Value = "MYPASSWORD"
Application.Wait (Now + TimeValue("0:00:01"))
Set Go = IE.document.getelementbyID("button-1036")
Go.Click
'Navigate to Work orders
Application.Wait (Now + TimeValue("0:00:02"))
Set IE = Nothing
End Sub
</code>
First 2 commands work fine, only the 3rd is giving me trouble.
Code:
[HTML]<a tabindex="0" class="x-btn x-unselectable x-box-item x-btn-buttondefault-medium" id="button-1036" role="button" aria-disabled="false" aria-hidden="false" style="margin: 0px; left: 0px; top: 178px; width: 300px; right: auto;" hidefocus="on" unselectable="on" data-componentid="button-1036">
<span class="x-btn-wrap x-btn-wrap-buttondefault-medium " id="button-1036-btnWrap" role="presentation" style="table-layout: fixed;" data-ref="btnWrap" unselectable="on">
<span class="x-btn-button x-btn-button-buttondefault-medium x-btn-text x-btn-button-center " id="button-1036-btnEl" role="presentation" data-ref="btnEl" unselectable="on">
<span class="x-btn-icon-el x-btn-icon-el-buttondefault-medium " id="button-1036-btnIconEl" role="presentation" data-ref="btnIconEl" unselectable="on"></span><span class="x-btn-inner x-btn-inner-buttondefault-medium" id="button-1036-btnInnerEl" data-ref="btnInnerEl" unselectable="on">LOG IN</span>
</span>
</span>
</a>
[/HTML]
I am trying to click this button with the following code.
<code>
Set Go = IE.document.getelementbyID("button-1036")
Go.Click
</code>
No dice. Here's the full code:
<code>
Private Sub CommandButton1_Click()
Dim IE As Object
Dim usr As Object
Dim pwd As Object
Dim Go As Object
Set IE = CreateObject("InternetExplorer.Application")
IE.Visible = False
'Go to this Web Page
IE.Navigate "https://eam-112.inforcloudsuite.com/web/base/logindisp?tenant=NAVISTARMFG_TRN"
'Check for good connection to web page loop
Do
If IE.ReadyState = 4 Then
IE.Visible = True
Exit Do
Else
DoEvents
End If
Loop
'Wait for window to open
Application.Wait (Now + TimeValue("0:00:01"))
IE.Visible = True
'Send logon information
Application.Wait (Now + TimeValue("0:00:01"))
Set usr = IE.document.getelementbyID("textfield-1034-inputEl")
usr.Value = "MYUSERNAME"
Set pwd = IE.document.getelementbyID("textfield-1035-inputEl")
pwd.Value = "MYPASSWORD"
Application.Wait (Now + TimeValue("0:00:01"))
Set Go = IE.document.getelementbyID("button-1036")
Go.Click
'Navigate to Work orders
Application.Wait (Now + TimeValue("0:00:02"))
Set IE = Nothing
End Sub
</code>
First 2 commands work fine, only the 3rd is giving me trouble.