PC Review


Reply
Thread Tools Rate Thread

Call a menu item

 
 
=?Utf-8?B?ZGtheWRrYXk=?=
Guest
Posts: n/a
 
      14th Feb 2007
I have a custom add in for work that adds another menu at the top of my
excel. I want to write a macro that includes calling an item in that menu.
When I record a macro and go to the item i need, it functions properly
(resets a bunch of dde links) but it doesn't record the code. Anyone know of
a way to call something in a menu by it's name or maybe reset all the dde
links on a worksheet?

Thanks in advance,
David
 
Reply With Quote
 
 
 
 
Chip Pearson
Guest
Posts: n/a
 
      14th Feb 2007
You can do it with code like


Application.CommandBars.ActiveMenuBar.Controls("MenuName"). _
Controls("ItemName").Execute



--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
(email address is on the web site)


"dkaydkay" <(E-Mail Removed)> wrote in message
news:28680021-9A2B-4430-BF8E-(E-Mail Removed)...
>I have a custom add in for work that adds another menu at the top of my
> excel. I want to write a macro that includes calling an item in that
> menu.
> When I record a macro and go to the item i need, it functions properly
> (resets a bunch of dde links) but it doesn't record the code. Anyone know
> of
> a way to call something in a menu by it's name or maybe reset all the dde
> links on a worksheet?
>
> Thanks in advance,
> David



 
Reply With Quote
 
Ron de Bruin
Guest
Posts: n/a
 
      14th Feb 2007
Hi dkaydkay

You can use Execute

Application.CommandBars("???").Controls("??").Execute


--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"dkaydkay" <(E-Mail Removed)> wrote in message news:28680021-9A2B-4430-BF8E-(E-Mail Removed)...
>I have a custom add in for work that adds another menu at the top of my
> excel. I want to write a macro that includes calling an item in that menu.
> When I record a macro and go to the item i need, it functions properly
> (resets a bunch of dde links) but it doesn't record the code. Anyone know of
> a way to call something in a menu by it's name or maybe reset all the dde
> links on a worksheet?
>
> Thanks in advance,
> David

 
Reply With Quote
 
=?Utf-8?B?ZGtheWRrYXk=?=
Guest
Posts: n/a
 
      14th Feb 2007
THANKS! Works great!

"Chip Pearson" wrote:

> You can do it with code like
>
>
> Application.CommandBars.ActiveMenuBar.Controls("MenuName"). _
> Controls("ItemName").Execute
>
>
>
> --
> Cordially,
> Chip Pearson
> Microsoft MVP - Excel
> Pearson Software Consulting, LLC
> www.cpearson.com
> (email address is on the web site)
>
>
> "dkaydkay" <(E-Mail Removed)> wrote in message
> news:28680021-9A2B-4430-BF8E-(E-Mail Removed)...
> >I have a custom add in for work that adds another menu at the top of my
> > excel. I want to write a macro that includes calling an item in that
> > menu.
> > When I record a macro and go to the item i need, it functions properly
> > (resets a bunch of dde links) but it doesn't record the code. Anyone know
> > of
> > a way to call something in a menu by it's name or maybe reset all the dde
> > links on a worksheet?
> >
> > Thanks in advance,
> > David

>
>
>

 
Reply With Quote
 
=?Utf-8?B?ZGtheWRrYXk=?=
Guest
Posts: n/a
 
      14th Feb 2007
Thanks!

"Ron de Bruin" wrote:

> Hi dkaydkay
>
> You can use Execute
>
> Application.CommandBars("???").Controls("??").Execute
>
>
> --
>
> Regards Ron de Bruin
> http://www.rondebruin.nl/tips.htm
>
>
> "dkaydkay" <(E-Mail Removed)> wrote in message news:28680021-9A2B-4430-BF8E-(E-Mail Removed)...
> >I have a custom add in for work that adds another menu at the top of my
> > excel. I want to write a macro that includes calling an item in that menu.
> > When I record a macro and go to the item i need, it functions properly
> > (resets a bunch of dde links) but it doesn't record the code. Anyone know of
> > a way to call something in a menu by it's name or maybe reset all the dde
> > links on a worksheet?
> >
> > Thanks in advance,
> > David

>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Programmatically call a menu item from a menu from a Add-in Thomas Microsoft Excel Programming 2 8th May 2008 02:21 AM
How to call a custom form from a new menu item? MeAgin Microsoft Outlook Discussion 1 12th Dec 2006 12:55 PM
Call Dispose() on removing menu item jens.ro Microsoft Dot NET Framework Forms 0 14th Apr 2006 06:25 PM
Not able to call a function from custom menu item that is added in word menu(File) jayrm100@yahoo.com Microsoft Word Document Management 0 9th Nov 2005 05:36 AM
call code from toolbar menu item Bill D Microsoft Access Form Coding 1 14th Sep 2004 06:54 PM


Features
 

Advertising
 

Newsgroups
 


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