PGD15
PGD15

Reputation: 183

VBA - How to select tab on webpage

I've seen a couple of questions similar to this but have had no success.

I am trying to write a piece of code after navigation to a secure webpage which will click on a tab and load this data (there is no URL behind the tab so cannot use that). I need to click on the sales tab which has the ID overview. Can someone please help me write a line of code which will find this object and click on it. HTML Code

Many thanks

fyi i tried stuff like

ie.document.getelementbyID("overview")(0).Click 

Upvotes: 1

Views: 2196

Answers (1)

QHarr
QHarr

Reputation: 84465

You can select

ie.document.querySelector("div[id=overview]")

So if clickable try:

ie.document.querySelector("div[id=overview]").Click

Or simply

ie.document.querySelector("#overview").Click

That is assuming the element isn't inside a form/frame/iframe. Can't tell from the small HTML sample though.

Upvotes: 1

Related Questions