Don't assign the macro to the button until you have made the file an addin.
--
Regards,
Tom Ogilvy
"Tom Doster" wrote in message
...
I've created an Excel Visual Basic subroutine that I want to share as an
Add-In. How do I make it so that the user can run the VB subroutine?
In the spreadsheet (.xls) source for the Add-In (.xla) I have created a
new
toolbar with a button assigned to the main macro. Then I compile the
Visual
Basic code and save the workbook as an Add-In file. I then close all
files,
make the Add-In available through the Add-In manager, open a new
spreadsheet, select some cells and then click on the toolbar button that I
linked to the Visual Basic subroutine. Trouble is: The toolbar button
wants
to run VB script from the original spreadsheet, not from the Add-In.
How do I tell the Excel toolbar (or menu, or whatever) to run the Visual
Basic subroutine that exists in my Add-In file?
Can I do that directly, or do I have to have some level of indirection:
The
toolbar calls a regular Visual Basic program that invokes the subroutine
in
the Add-In?
I have Microsoft Excel 2002 on Windows XP Pro.
Thanks,
Tom Doster