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

  • Thread starter Thread starter Guest
  • Start date Start date
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?
 
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?
 
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.
 
Back
Top