Going from IE to Google Chrome.

Mromano

New Member
Joined
Jan 30, 2017
Messages
37
I am trying to change my code from IE to Google Chrome and I am getting stuck on the ready state.


Option Explicit


Const MyUserName As String = "ABCOFA"
Const MyPassword As String = "******"
Const dayfrom As String = "12/01/2015"
Const READYSTATE_COMPLETE As Integer = 4


Dim chromePath As String
Dim objie As Object




Public Sub Billing()

'Set objie = CreateObject("InternetExplorer.Application")
chromePath = """C:\Program Files\Google\Chrome\Application\chrome.exe"""


' With objie
' .Visible = True
' .Silent = True
' .Navigate ("https://www.servicechannel.com/sc/login/client_login.asp")
Shell (chromePath & " -url https://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


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

For Each ele In objie.Document.getelementsbytagname("button")
If ele.Name = "butLaunchExcel" Then
ele.Click
Exit For
End If
Next ele



End Sub
 

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.

Forum statistics

Threads
1,223,903
Messages
6,175,279
Members
452,630
Latest member
OdubiYouth

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