JS Hover Menu using VBA

Darkcloud617

New Member
Joined
Sep 7, 2017
Messages
38
Hello,

I am having an issue regarding "clicking" through a hover drop down menu on a website. The drop down menu looks like this Hover.PNG and is the 6th button from the left on the websites nav bar.



and the website code that refers to that drop down is: hover2.PNG



When you hover over "All Open Orders in view" the class changes from "MenuBar_Menu_Item" to "MenuBar_Menu_Item MenuBar_Menu_Item_Hover". The below is the relevant part of the VBA code I am trying to get to click the option "All Open Orders in view":

VBA Code:
Document.getElementsByClassName("MenuBar_Menu")(1).Click

There is other code "onclick", "onmouseover" etc but im not familiar with incorporating that into VBA. That code errors "object required" but I've tried many different iterations. Any ideas would be greatly appreciated.

Thank you.
 

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.
Here is another VBA code I am trying but it seems to have the same issue:

VBA Code:
.document.getelementsbyclassname("MenuBar_Menu_Item").document.getelementsbyid("Main_Main_mbMain_5")(0).Click
 
Upvote 0

Forum statistics

Threads
1,224,819
Messages
6,181,153
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top