Clicking an unselectable button in IE

nairion

New Member
Joined
Dec 13, 2016
Messages
18
Button:
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.
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.

Forum statistics

Threads
1,214,968
Messages
6,122,509
Members
449,089
Latest member
RandomExceller01

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top