Hi Everyone,
I am hoping that you can help me with this issue. I am trying to automate getting onto a website and clicking a button. Thus far, I have not been able to determine where the issue is.
________________________________
Sub Test()Dim oHTML_Element As IHTMLElement
Dim oBrowser As InternetExplorer
Dim ie As Variant
Set ie = CreateObject("InternetExplorer.Application")
ie.Visible = True
ie.Navigate "Website goes here"
While ie.ReadyState <> READYSTATE_COMPLETE And ie.ReadyState <> READYSTATE_LOADED
DoEvents
Wend
For Each oHTML_Element In ie.Document.getElementsById("WD2A")
oHTML_Element.Click
Next
End Sub
______________________
I am getting a runtime error 438: Object doesn't support this property or method.
The HTML code for the button is as follows:
<a tabIndex="0" title="Click here" class="lsControl--Valign urLnkFunction ur TxtEmph LsTextNoWrapping" id="WD2A" style="WHITE-SPACE: nowrap" ondragstart="var e=window.event;e.cancelBubble=true;e.returnValue=false;return false;"href="javascript:void(0);" shape="" ct="LN" ti="0" lsevents="{Activate: [{ResponseDate:'delta',ClientAction:'submit'},{}]}"
Please advise.
Thank you,
I am hoping that you can help me with this issue. I am trying to automate getting onto a website and clicking a button. Thus far, I have not been able to determine where the issue is.
________________________________
Sub Test()Dim oHTML_Element As IHTMLElement
Dim oBrowser As InternetExplorer
Dim ie As Variant
Set ie = CreateObject("InternetExplorer.Application")
ie.Visible = True
ie.Navigate "Website goes here"
While ie.ReadyState <> READYSTATE_COMPLETE And ie.ReadyState <> READYSTATE_LOADED
DoEvents
Wend
For Each oHTML_Element In ie.Document.getElementsById("WD2A")
oHTML_Element.Click
Next
End Sub
______________________
I am getting a runtime error 438: Object doesn't support this property or method.
The HTML code for the button is as follows:
<a tabIndex="0" title="Click here" class="lsControl--Valign urLnkFunction ur TxtEmph LsTextNoWrapping" id="WD2A" style="WHITE-SPACE: nowrap" ondragstart="var e=window.event;e.cancelBubble=true;e.returnValue=false;return false;"href="javascript:void(0);" shape="" ct="LN" ti="0" lsevents="{Activate: [{ResponseDate:'delta',ClientAction:'submit'},{}]}"
Please advise.
Thank you,