Dim Login As String
Dim Password As String
Login = "xxxxxx"
Password = "xxxxxx"
Dim PageScale As Variant: PageScale = 0.85
Dim TimeOut As Integer: TimeOut = 20
Me.EdgeBrowser0.Visible = True
Me.EdgeBrowser0.Navigate "https://secure.uat.pcse.england.nhs.uk/"
Do While Me.EdgeBrowser0.ReadyState <> 4
DoEvents
Loop
y = Timer + TimeOut
FromStartAgain:
If Not Me.EdgeBrowser0.RetrieveJavascriptValue("document.documentElement.innerHTML") Like "*" & "Forgotten your login details?" & "*" Then
x = Timer + 2
Do While Timer < x
DoEvents
Loop
If Timer > y Then
MsgBox "Page failed to load in time."
Exit Sub
End If
DoEvents
GoTo FromStartAgain
End If
'Loop
Me.EdgeBrowser0.ExecuteJavascript ("document.body.style.transform='scale(" & PageScale & ")';")
Me.EdgeBrowser0.ExecuteJavascript "document.getElementById('PlaceHolderMain_signInControl_UserName').value =" & Chr(34) & Login & Chr(34) & ";"
Me.EdgeBrowser0.ExecuteJavascript "document.getElementById('PlaceHolderMain_signInControl_password').value =" & Chr(34) & Password & Chr(34) & ";"
Me.EdgeBrowser0.ExecuteJavascript "document.getElementById('PlaceHolderMain_signInControl_login').click();"
y = Timer + TimeOut
FromStartAgain2:
If Not Me.EdgeBrowser0.RetrieveJavascriptValue("document.documentElement.innerHTML") Like "*" & "Track claims, view statements and easily reconcile your payments." & "*" Then
x = Timer + 2
Do While Timer < x
DoEvents
Loop
If Timer > y Then
MsgBox "Page failed to load in time."
Exit Sub
End If
DoEvents
GoTo FromStartAgain2
End If
'Loop
Me.EdgeBrowser0.ExecuteJavascript ("document.body.style.transform='scale(" & PageScale & ")';")
Me.EdgeBrowser0.Navigate "https://secure.uat.pcse.england.nhs.uk/OPH/OphthalmicGosFour/GOSFour"
Do While Me.EdgeBrowser0.ReadyState <> 4
DoEvents
Loop
y = Timer + TimeOut
'Do Until InStr(1, Me.EdgeBrowser0.RetrieveJavascriptValue("document.documentElement.innerHTML"), "Search for your residential address by entering your postcode") > 0
PatientDetailsNotLoaded:
If Not Me.EdgeBrowser0.RetrieveJavascriptValue("document.documentElement.innerHTML") Like "*" & "Search for your residential address by entering your postcode" & "*" Then
x = Timer + 5
Do While Timer < x
DoEvents
Loop
If Timer > y Then
MsgBox "Page failed to load in time."
Exit Sub
End If
DoEvents
GoTo PatientDetailsNotLoaded
End If
'Loop
Me.EdgeBrowser0.ExecuteJavascript ("document.body.style.transform='scale(" & PageScale & ")';")
Me.EdgeBrowser0.ExecuteJavascript "document.getElementById('titleCode').selectedIndex = 1;"
Me.EdgeBrowser0.ExecuteJavascript "document.getElementById('FirstName').value =" & Chr(34) & "Harry" & Chr(34) & ";"
Me.EdgeBrowser0.ExecuteJavascript "document.getElementById('Surname').value =" & Chr(34) & "Barry" & Chr(34) & ";"
Me.EdgeBrowser0.ExecuteJavascript "document.getElementById('txtDateOfBirth').value =" & Chr(34) & Format("01/01/1999", "dd/mm/yyyy") & Chr(34)