Call a menu item

D

dkaydkay

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
 
C

Chip Pearson

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)
 
R

Ron de Bruin

Hi dkaydkay

You can use Execute

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

dkaydkay

THANKS! Works great!

Chip Pearson said:
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)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top