VBA auto login with Chrome

Enzo_Matrix

Board Regular
Joined
Jan 9, 2018
Messages
113
I found and modified a code that will let me automatically log into the site I want but I can't figure out how to change from IE to Chrome.

please help
Code:
Sub wisdomone()

Dim HTMLDoc As HTMLDocument
Dim MyBrowser As InternetExplorer
Dim Myhtml_Element As IHTMLElement
Dim MyURL As String
On Error GoTo Err_Clear


MyURL = "www.website.com"
Set MyBrowser = New InternetExplorer
MyBrowser.Silent = True
MyBrowser.navigate MyURL
MyBrowser.Visible = True


Do
Loop Until MyBrowser.readyState = READYSTATE_COMPLETE
Set HTMLDoc = MyBrowser.document
HTMLDoc.all.txtUSername.Value = "username"
HTMLDoc.all.txtPassword.Value = "password"
HTMLDoc.all.txtClient.Value = "clientID"


For Each Myhtml_Element In HTMLDoc.getElementsByTagName("Input")
    If Myhtml_Element.Type = "Submit" Then Myhtml_Element.Click: Exit For
        Next
Err_Clear:
    If Err <> 0 Then
    Err.Clear
    Resume Next
End If


End Sub
 

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.

Forum statistics

Threads
1,223,227
Messages
6,170,849
Members
452,361
Latest member
d3ad3y3

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