Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Is it possible to execute a menuitem from the standard Excel menu with VBA code?
I have tried this (and several variations) with no luck: MenuBars(xlWorksheet).Menus("Data").MenuItems("For m...").Execute I am trying to open the Data form in the above code but I would like to do other things to. And, for general knowledge, is "Commandbars" interchangeable with "MenuBars"? Thank you |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Susan
MenuBars probably still works, but it's the old way. It's not completely interchangeable with Commandbars because toolbars are commandbars, but not menubars. I think the problem with your code is that xlWorksheet isn't a proper index of a menu. Try this Sheet1.ShowDataForm If you want to use the menu, it would look like this CommandBars(1).Controls("Data").Controls("Form..." ).Execute -- Dick Kusleika MVP - Excel Excel Blog - Daily Dose of Excel www.dicks-blog.com Susan wrote: Is it possible to execute a menuitem from the standard Excel menu with VBA code? I have tried this (and several variations) with no luck: MenuBars(xlWorksheet).Menus("Data").MenuItems("For m...").Execute I am trying to open the Data form in the above code but I would like to do other things to. And, for general knowledge, is "Commandbars" interchangeable with "MenuBars"? Thank you |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Dick Kusleika wrote:
Susan MenuBars probably still works, but it's the old way. It's not completely interchangeable with Commandbars because toolbars are commandbars, but not menubars. I think the problem with your code is that xlWorksheet isn't a proper index of a menu. Try this Sheet1.ShowDataForm If you want to use the menu, it would look like this CommandBars(1).Controls("Data").Controls("Form..." ).Execute Thanks, Dick |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How disable menu command | Excel Discussion (Misc queries) | |||
Name command in Insert Menu | Excel Discussion (Misc queries) | |||
How do I execute buttons in Excel using a voice command? | Excel Discussion (Misc queries) | |||
How do I execute command from button or hyperlink? | Excel Discussion (Misc queries) | |||
Execute a command line app but i want a string returned. | Excel Programming |