Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Kevin,
I doesn't matter what I put there. My original program called "myprog.xla!mysub" which worked but fired when it was declared and then never fires when the button is clicked. I only want it to fire when the user clicks the button. I'm stumped. Any other ideas? Thanks for the feedback. The OnAction property of a commandbar should *not* be the actual code that you want to run when the button is clicked, but instead should be a reference to a routine that you want to run. So instead of: cmdOpen.OnAction = MsgBox("Runs When First Set!") You need to use: cmdOpen.OnAction = "'" & ThisWorkbook.Name & "'!SomeMacroName" 'Put in a standard module Sub SomeMacroName() MsgBox "Runs when button is clicked!" End Sub Regards Stephen Bullen Microsoft MVP - Excel www.BMSLtd.co.uk |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
R/T 1004 - Unable to get Button prop of Ws Class | Excel Discussion (Misc queries) | |||
TEMPLATE IN EXCEL FOR MONTHLY PAYMENTS FOR MORE THAN ONE PROP | New Users to Excel | |||
Drop Down Selection fires a module? | Excel Worksheet Functions | |||
Thanks - creating a commandbarbutton with a custom bitmap | Excel Programming | |||
creating a commandbarbutton with a custom bitmap | Excel Programming |