K
kevin
I'm programmatically building a menu bar with a series of
command buttons but I'm having trouble assigning the
command for the button. Every time I set the .OnAction
property, the action fires. Then future clicks of the
button do nothing. This is really frustrating since I
know it should be an easy fix. How do I assign the value
of the command I want to call for a command button on my
command bar. Here is an excerpt from my
code;
Dim cmdOpen As CommandBarButton
Set cmdOpen = cbpPGDFile.Controls.Add
(msoControlButton, , , , True)
cmdOpen.Caption = "Open/New PGD File"
cmdOpen.OnAction = MsgBox("I don't want this
to run when setting the property but it does!")
command buttons but I'm having trouble assigning the
command for the button. Every time I set the .OnAction
property, the action fires. Then future clicks of the
button do nothing. This is really frustrating since I
know it should be an easy fix. How do I assign the value
of the command I want to call for a command button on my
command bar. Here is an excerpt from my
code;
Dim cmdOpen As CommandBarButton
Set cmdOpen = cbpPGDFile.Controls.Add
(msoControlButton, , , , True)
cmdOpen.Caption = "Open/New PGD File"
cmdOpen.OnAction = MsgBox("I don't want this
to run when setting the property but it does!")