Why oh why cant I hit the "Continue" button? Excel VBA to open a website and log in to next stage

tyler56895

New Member
Joined
Jul 28, 2020
Messages
3
Office Version
  1. 365
Platform
  1. Windows
Its fairly clear I have no idea what I'm doing!
With previous help, I've managed to get the Username and Date of Birth fields to populate, but not matter what I try I cant get the Continue button to click. Worryingly, I've got another field to populate once i get the Continue button pressed! To not confuse the issue, I've removed all the attempts to hit the continue button from the code.

VBA Code:
Sub HL()

Dim HTMLDoc As HTMLDocument
Dim MyBrowser As InternetExplorer
Dim MyHTML_Element As IHTMLElement
Dim MyURL As String

MyURL = "https://online.hl.co.uk/my-accounts/login-step-one"

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.UserName.Value = "myusername"
HTMLDoc.all.Item("date-of-birth").Value = "010101"

End Sub
 

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.

John_w

MrExcel MVP
Joined
Oct 15, 2007
Messages
7,546
Try submitting the login form:
VBA Code:
    HTMLDoc.getElementById("login").submit
 

Forum statistics

Threads
1,176,094
Messages
5,901,370
Members
434,887
Latest member
zoath

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
Top