VikasSharma Posted February 5, 2021 Posted February 5, 2021 Hello All, Need help to understand how we can select Excel 365 menu option without using Alt key. Reason is Menu is dynamic and may not work on client machine. Eg. Support i am using Alt+4 to Select Analysis menu, if it goes to client and they might have different menu option and Analysis menu option might be come at Alt+6. So my program will failed. Enclosed is the excel menu snapshot. Scenario: I have to select the "Analysis" Menu from Menu bar. I have tried functions like _GUICtrlTreeView_FindItem, WinMenuSelectItem and ControlFocus, but unfortunatelytly none is working in office 365. Try 1: local $treeHndl local $treeItem = _GUICtrlTreeView_FindItem($treeHndl, "Analysis") Sleep (10000) _GUICtrlTreeView_SelectItem ($treeHndl, $treeItem, 1) MsgBox(0, "You entered:", "Web Service URL: " & $treeItem) Try 2: ;WinMenuSelectItem("Class:XLMAIN", "Book1 - Excel", "Analysis") Try 3: ControlFocus("CLASS:XLMAIN", "Book1 - Excel", "Analysis") ControlSend("CLASS:WindowsForms10.EDIT.app.0.13277ca_r107_ad6", "", "INSTANCE:7", "{DEL 10}") Any kind guidance, will be of great help. Best Regards, Vikas
dmob Posted February 5, 2021 Posted February 5, 2021 Why not just record a macro then convert the resulting VBA code to AutoIt?
VikasSharma Posted February 9, 2021 Author Posted February 9, 2021 @dmob Thanks for prompt help. But I found that excel macro doesn't work for Custom Menu selection. Like Analysis is a add-in menu and macro is not able to handle it.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now