Have Programmically Created new Button for Macro, but does not execute

G

Guest

I have created and added a new button to the Standard CommandBar using a setup macro. Clicking it does not execute the assigned macro. If I create the same button through Toolbars|Custom, I can click it to execute the macro. I have examined both of the Item Collections, and, on the surface, everything seems to be the same. Except the .BuiltIn is False and it is set to read-only, thus I cannot change it through code.

If I create a new button through code, what item varibles do I need to set to allow the macro to execute when the user presses the button?
 
M

Matthew

There's a big market for new Butts! Congratulations!

Matthew

=}
-----Original Message-----
I have created and added a new button to the Standard
CommandBar using a setup macro. Clicking it does not
execute the assigned macro. If I create the same button
through Toolbars|Custom, I can click it to execute the
macro. I have examined both of the Item Collections,
and, on the surface, everything seems to be the same.
Except the .BuiltIn is False and it is set to read-only,
thus I cannot change it through code.
If I create a new button through code, what item
varibles do I need to set to allow the macro to execute
when the user presses the button?
 
G

Guest

Have found the answer...

For macros assigned to Custom Controls, you have to enter the macro name into the .OnAction property of the control, not the .Execute property.
 

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