Click button not working

Status
Not open for further replies.

Mromano

New Member
Joined
Jan 30, 2017
Messages
37
I am trying to click a button on a website. My code works on three button but not the last for some reason it is the last next that does not work.

Public Sub Billing()

Set objie = CreateObject("InternetExplorer.Application")

With objie
.Visible = True
.Silent = True
.Navigate ("http://www.servicechannel.com/sc/login/client_login.asp")

Do Until .ReadyState = READYSTATE_COMPLETE
DoEvents
Loop
Application.Wait Now() + TimeValue("00:00:01")
.Document.all.UserName.Value = MyUserName
.Document.all.Password.Value = MyPassword
.Document.all.RememberMe.Value = True
.Document.forms(0).submit
Do Until .ReadyState = READYSTATE_COMPLETE
DoEvents
Loop
Application.Wait Now() + TimeValue("00:00:01")
End With


With objie
.Visible = True
.Silent = True
.Navigate ("http://www4.servicechannel.com/sc/login/reports/workhistory.asp?rpst=5")
Do Until .ReadyState = READYSTATE_COMPLETE
DoEvents
Loop
Application.Wait Now() + TimeValue("00:00:01")
End With

objie.Document.getElementById("arrow-collapse4").Click
objie.Document.all.dayfrom.Value = dayfrom
objie.Document.getElementById("arrow-collapse7").Click

Dim ele As Object


For Each ele In objie.Document.getElementsByTagName("input")
If ele.Value = "PF" Then ele.Click: Exit For
Next

For Each ele In objie.Document.getElementsByTagName("input")
If ele.Value = "msexc" Then ele.Click: Exit For
Next
For Each ele In objie.Document.getElementsByTagName("input")
If ele.Value = "Retrieve Report" Then ele.Click: Exit For

Next


For Each ele In objie.Document.getElementsByTagName("input")
If ele.Value = "Launch Excel" Then ele.Click: Exit For

Next


End Sub

inspect code


'<input class="btn btn-primary" type="button" name="butLaunchExcel" value="Launch Excel" *******="ExcelLaunch()"> == $0
 

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
Status
Not open for further replies.

Forum statistics

Threads
1,215,052
Messages
6,122,878
Members
449,097
Latest member
dbomb1414

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