I am new to VBA and hope someone here can help me with the following:
I would like to use VBA to open a website and then click two different buttons on this website.
My challenges with this are:
1) How can I tell the code to wait until the webpage is fully loaded so that I can make sure the button that I want to click is actually visible ?
2) How do I address the button correctly using it's unique ID ?
My code so far:
Dim varResults As New DataObject
Dim varButtonID As String
Dim i As Long
Dim objIE As Object
Dim objElement As Object
Dim objCollection As Object
varResults.SetText TxtSql.Text
varResults.PutInClipboard
' assign button ID
varButtonID = "Oracle_setExplainOptionsSpan"
' create IE object
Set objIE = CreateObject("InternetExplorer.Application")
With objIE
.navigate "https://myURL"
.Visible = True
End With
While objIE.ReadyState <> 4: Wend
objIE.document.getElementById(varButtonID).Click
Many thanks in advance for any help with this, Mike