I am trying to use VBA code to click a "Go" button on a website. This is the source code.
<div class="actions">
<a id="go" href="javascript:void(null);" title="Go"><img src="/images/button-go-smaller.png"></a>
<a id="reset" href="javascript:void(null);" title="Reset All Fields"><img src="/images/button-reset_all.png"></a>
</div>
This is my VBA code:
For Each obj In objCollection
If objCollection(i).ID = "go" Then
Set objElement = obj
Exit For
End If
Next obj
objElement.Click
However, on the objElement.Click line, I get an error 91, which means that the "go" action cannot be found. Why is that, and how can I access the go button?
objvariable? Also you are not incrementingithrough each loop.