enter image description hereI am a newbie trying to automate some routine procedures through Excel vba. But I can't access the HTML element that I want to click.I would like to click on the menu titled "Prize Bonds" and then would like to click to one of the submenus it opens up. I have tried to access it by tag, tagname, css, but nothing works. The error is not due to finding the element. I use wait to load the site so that the presence of element is not an issue.My code doesn't give any error but it also won't click on the menus stated. I am uploading the images to show DOM and finding the HTML element. The code is
Sub auto_ie()
Dim IE As New SHDocVw.InternetExplorer
Dim usrname As Variant
Dim pass As Variant
Dim MSDOC As MSHTML.HTMLDocument
Dim inputs As MSHTML.IHTMLElement
Dim passwords As MSHTML.IHTMLElement
Dim singin As MSHTML.IHTMLElement
Dim Anchors As MSHTML.IHTMLElementCollection
Dim anchor As MSHTML.IHTMLElement
[[enter image description here](https://i.stack.imgur.com/g7cft.png)](https://i.stack.imgur.com/Ycog8.png)
usrname = ""
pass = ""
IE.Visible = True
IE.navigate ("")
Do While IE.readyState <> READYSTATE_COMPLETE
Loop
Set MSDOC = IE.document
Set inputs = MSDOC.getElementById("signOnName")
inputs.Value = usrname
Set inputs = MSDOC.getElementById("password")
inputs.Value = pass
Set singin = MSDOC.getElementById("sign-in")
singin.Click
Do While IE.readyState <> READYSTATE_COMPLETE
Loop
Do Until IE.readyState = 4
DoEvents
Loop
Set Anchor = MSDOC.getElementsByTagName("img")
For Each anchor In Anchors
if anchor.innertext = "Prize Bonds" then
anchor.click()
End if
Exit for
Next anchor
End Sub
I have already described that I used different methods to get to the right HTML element and click it but they won't work