Hi.
I am trying to use my VBA code to click a button on an IE Web page. I have tried various lines of code but keep getting the Object Error 424.
Below is the web page code detailing the button....
The VBA code I have tried includes:
Any help greatfully received.
I am trying to use my VBA code to click a button on an IE Web page. I have tried various lines of code but keep getting the Object Error 424.
Below is the web page code detailing the button....
HTML:
<td id="cellInvestment </br>Choice" align="left" name="cellInvestment </br>Choice" class="wizardNavSelected"
onclick = "return wizard_move('/Admin/ModelPortfolios/InvestmentChoice.aspx','');"
style="CURSOR: pointer;">
<span class="roundSelected"></span>
<span class = "WizardNavNumber">2. </span>Investment </br>Choice
</td>
The VBA code I have tried includes:
VBA Code:
Set btn = ie.document.getElementById("cellInvestment")
btn.Click
ie.document.querySelector("button[type=submit]").click
The macro code looks like:
Sub Macro3()
Dim a As String
Set App = CreateObject("InternetExplorer.Application")
'Creates IE Webpage
With App
.Visible = True
.Navigate "[URL]https://HIDDEN[/URL]"
Do Until .ReadyState = 4
DoEvents
Loop
End With
Set btn = ie.document.getElementById("cellInvestment")
btn.Click
Any help greatfully received.
Last edited by a moderator: