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

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.

Forum statistics

Threads
1,215,214
Messages
6,123,660
Members
449,114
Latest member
aides

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