Macro in current or personnal workbook?


Posted by amroo on May 15, 2001 12:14 AM

Bonjour, When I want to save a macro I don't know what is the best : Current or personnal worbook?
I want my macro used in different workbook, so if I have saved it in a current wrkbk what do I do for save it in the personnal wrkbk?Copy and past it ?
Help was greatly appreciate.
A+mroo



Posted by Dave Hawley on May 15, 2001 1:12 AM

Hi Amroo

Yes, your "Personal Macro Workbook" is an option. You can just copy and paste in the code. If you do not have a "Personal Macro Workbook" yet, just Record a Macro to it.


A better option would be to save the file with the code as an Add-in. This would mean you could have a button or buttons Automatically added to your Toolbar that would run the macros. Then have them automatically deleted whenever the Add-in is uninstalled. To do this you would need to place some code in the "ThisWorkbook" Private Module.
"Workbook_AddinInstall" and "Workbook_AddinUninstall"


Whichever option you go for make certain you don't have any code refering to ThisWorkbook, if you do use Edit>Replace to change it to "ActiveWorkbook"


Dave

OzGrid Business Applications