Custom Toolbar Macros

M

Merlzie

Maybe someone can lend a hand...

I looking for a method of setting a macro to a custom
toolbar button via VBA. My problem is that the custom
toolbar isn't workbook specific and everytime a new file
is opened, the toolbar button looks to execute the macro
from the last file.

Thanks
 
T

Tom Ogilvy

object.OnAction = "MyWorkbook.xls!MyMacro"

where object would be a reference to your toolbar button and MyWorkbook.xls
is open. If it will be closed, put in the path as well.
 

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