Problem with assigining a macro.

S

shashi1515

Hello,

I have created a floating menu bar with 3 menu buttons on it. I have
written a sub programs for each button, for the action to be performed
when the menu buttons are clicked. And I have assigned the code to the
buttons using "Assign macro". This works fine unitll the workbook is
closed. When I close & re-open the workbook and click on menu
buttons....I get a message that it could not find assigned macros. I
saved the workbook before closing. I tried many times, but could not
find the reason. Please help.

Thanks,
Shashi
 
T

Tom Ogilvy

run a macro to check on the assignment

Sub showAssignments()
for each btn in CommandBars("MyBar").Controls
msgbox btn.Caption & vbNewline & btn.OnAction
Next
End Sub

Try it before closing the workbook, when the workbook is closed and when
you have a problem.


I create custom bars all the time when I am testing things. I will make
them visible weeks or months later, and click a button and it opens some old
file it was assigned to and runs the macro. So this isn't typical.
 
G

Guest

You need to attach the floating menu bar to the workbook - use the attach
command in the worksheet menu bar to do this.
 

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