Hi, I am looking to click a button on this webpage Geology of Britain viewer | British Geological Survey (BGS), specifically the one labelled Go To Location (RHS). I cant figure out what its reference is when I look at the source code. My VBA is below, which doesn't work...
I have also tried ieDoc.Document.forms(0).submit
but that didt work either. Any suggestions?
Code:
Sub Geol()
Dim sht As Worksheet
Dim IE As Object
Dim ieDoc As HTMLDocument
Dim Item As Variant
Dim SignInButton As HTMLInputButtonElement
Set sht = ActiveSheet
Set IE = CreateObject("InternetExplorer.Application")
'Open IE
IE.Visible = True
IE.Navigate "[URL="http://mapapps.bgs.ac.uk/geologyofbritain/home.html"]Geology of Britain viewer | British Geological Survey (BGS)[/URL]"
'Wait until site is loaded
Do While IE.readyState <> 4 'READYSTATE_COMPLETE
DoEvents
Loop
'Get the body
Set ieDoc = IE.Document
'Fill the information
'ieDoc.getElementById("txtPostCode").Value = sht.Range("L11").Value
Set SignInButton = ieDoc.getElementById("locationDlg_underlay")
'SignInButton.Focus
'SignInButton.Click
End Sub
but that didt work either. Any suggestions?