Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 33
Default Selecting Menu Item by VBA Code

I have an add-in which adds its own menu to the Excel program. I need to be
able to select a shortcut menu item by VBA to update the information
displayed on the worksheet. This will automate the update process for the
information (otherwise, will need to manually right-click and select the
menuitem ~20 times).

Thanx in advance.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Selecting Menu Item by VBA Code

Hi

Application.CommandBars.FindControl(, 30010).Controls("&Google Search").Execute
This example will run a control on the Help menu for example

Post back with the name of your control and where it is if you need more help
For ID numbers see
http://www.rondebruin.com/menuid.htm



--
Regards Ron de Bruin
http://www.rondebruin.nl


"PosseJohn" wrote in message ...
I have an add-in which adds its own menu to the Excel program. I need to be
able to select a shortcut menu item by VBA to update the information
displayed on the worksheet. This will automate the update process for the
information (otherwise, will need to manually right-click and select the
menuitem ~20 times).

Thanx in advance.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Selecting Menu Item by VBA Code

John,

I would have thought that the best way was to set an object variable to the
men u item when creating it

Set myMenuItem =
Application.Commandbars("Standard").Controls.Add(T ype:=msoControlButton,temp
orary:=true)
myMenuItem.Caption = "abc"
etc.

Declare myMenuItem as a global object variable, and you can refer to that
anywhere in the code.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"PosseJohn" wrote in message
...
I have an add-in which adds its own menu to the Excel program. I need to

be
able to select a shortcut menu item by VBA to update the information
displayed on the worksheet. This will automate the update process for the
information (otherwise, will need to manually right-click and select the
menuitem ~20 times).

Thanx in advance.



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Selecting an item from a list [email protected][_2_] New Users to Excel 1 October 9th 07 05:50 PM
Group Boxes - selecting more than one item Katie-Baughman Excel Discussion (Misc queries) 3 May 13th 05 06:15 PM
Menu items added with menu item editor in older versions Michael Hoffmann Excel Discussion (Misc queries) 2 January 7th 05 01:40 PM
Selecting an Item from a List and getting a different item to pop. Matt Excel Worksheet Functions 1 December 7th 04 02:37 PM
Adding a menu item right click menu when clicking on a single. Andoni[_28_] Excel Programming 0 September 2nd 04 10:23 PM


All times are GMT +1. The time now is 03:28 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"