ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Programmatically call a menu item from a menu from a Add-in (https://www.excelbanter.com/excel-programming/410586-programmatically-call-menu-item-menu-add.html)

Thomas

Programmatically call a menu item from a menu from a Add-in
 
I have the Hyperion Smart View add-in in my Excel. I tried to add a command
button which basically will call a command item on this Hyperion menu.

When I used the
Application.CommandBars("Hyperion").Controls("Memb er Select...").Execute

in the VBA code, it does not work. The error message is "Runtime error 5:
invalid procedure call or argument".

If I call an Excel standard menu item, it works fine.

Does anyone know how to programmatically call a non-Excel standard menu item
that comes from a third-party add-in?

Thanks a lot in advance!


Jim Cone[_2_]

Programmatically call a menu item from a menu from a Add-in
 
Try this version (assumes the Hyperion control is on the Excel menu bar)...
Application.CommandBars(1).Controls("Hyperion").Co ntrols("Member Select...").Execute

If the above doesn't work then it probably means that the Member Select item contains
additional controls and you will have to choose one...

Application.CommandBars(1).Controls("Hyperion") _
..Controls("Member Select...").Controls("Sludge").Execute
--
Jim Cone
Portland, Oregon USA
http://www.realezsites.com/bus/primitivesoftware
(Excel Add-ins / Excel Programming)



"Thomas"
wrote in message
I have the Hyperion Smart View add-in in my Excel. I tried to add a command
button which basically will call a command item on this Hyperion menu.

When I used the
Application.CommandBars("Hyperion").Controls("Memb er Select...").Execute

in the VBA code, it does not work. The error message is "Runtime error 5:
invalid procedure call or argument".
If I call an Excel standard menu item, it works fine.
Does anyone know how to programmatically call a non-Excel standard menu item
that comes from a third-party add-in?
Thanks a lot in advance!


Thomas

Programmatically call a menu item from a menu from a Add-in
 
Wow, that works. It seems that for non-Excel standard, I should use this
syntax.

Thanks a lot for the quick help!

Thomas

"Jim Cone" wrote:

Try this version (assumes the Hyperion control is on the Excel menu bar)...
Application.CommandBars(1).Controls("Hyperion").Co ntrols("Member Select...").Execute

If the above doesn't work then it probably means that the Member Select item contains
additional controls and you will have to choose one...

Application.CommandBars(1).Controls("Hyperion") _
..Controls("Member Select...").Controls("Sludge").Execute
--
Jim Cone
Portland, Oregon USA
http://www.realezsites.com/bus/primitivesoftware
(Excel Add-ins / Excel Programming)



"Thomas"
wrote in message
I have the Hyperion Smart View add-in in my Excel. I tried to add a command
button which basically will call a command item on this Hyperion menu.

When I used the
Application.CommandBars("Hyperion").Controls("Memb er Select...").Execute

in the VBA code, it does not work. The error message is "Runtime error 5:
invalid procedure call or argument".
If I call an Excel standard menu item, it works fine.
Does anyone know how to programmatically call a non-Excel standard menu item
that comes from a third-party add-in?
Thanks a lot in advance!




All times are GMT +1. The time now is 01:52 AM.

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