ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Executinh Addin Sub Menu Command (https://www.excelbanter.com/excel-programming/337840-executinh-addin-sub-menu-command.html)

Norman Jones

Executinh Addin Sub Menu Command
 
Hi Amir,

Why not call the relevant macro from the addin?

E.g.:

Application.Run ("MyAddin.xla!TheMenuMacro")


---
Regards,
Norman



"Amir" wrote in message
...
Hi,

I'm trying to use VBA to execute a sub menu command which was created by
an addin i've installed.

I know I can execute commands in the main command bar in Excel using
command line like this:

CommandBars("WorkSheet Menu Bar").Controls("Tools").Execute

What I wish to do is to execute a command which is in a sub menu under the
"Tools" menu. The desired button is placed he
"WorkSheet Menu Bar" - "Tools" - "MyAddinCustomMenu" -
"MyAddinCustomSubMenu" - "MyAddinSpecificButton"

By now I've solved that by using Tools - Customize to move that specific
button from the addin sub menu to the Worksheet Menu Bar so that I could
execute it using:
CommandBars("WorkSheet Menu
Bar").Controls("MyAddinSpecificButton").Execute

The problem is that it requires each user to do that customization for the
code to work. I addition it doesn't look proffessional.

How can I execute that button using a code in VBA, without moving it to
the Worksheet menu bar?

Regards,
Amir.




Amir

Executinh Addin Sub Menu Command
 
Hi,

I'm trying to use VBA to execute a sub menu command which was created by an
addin i've installed.

I know I can execute commands in the main command bar in Excel using command
line like this:

CommandBars("WorkSheet Menu Bar").Controls("Tools").Execute

What I wish to do is to execute a command which is in a sub menu under the
"Tools" menu. The desired button is placed he
"WorkSheet Menu Bar" - "Tools" - "MyAddinCustomMenu" -
"MyAddinCustomSubMenu" - "MyAddinSpecificButton"

By now I've solved that by using Tools - Customize to move that specific
button from the addin sub menu to the Worksheet Menu Bar so that I could
execute it using:
CommandBars("WorkSheet Menu Bar").Controls("MyAddinSpecificButton").Execute

The problem is that it requires each user to do that customization for the
code to work. I addition it doesn't look proffessional.

How can I execute that button using a code in VBA, without moving it to the
Worksheet menu bar?

Regards,
Amir.




All times are GMT +1. The time now is 01:29 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com