In 97, how do you copy a VBA module from ThisWorkbook to ActiveWorkbook ?
I have tried:
Set exportmodule = ThisWorkbook.VBProject.VBComponents("Update_Summary").CodeModule
to capture the code of the module in the variable exportmodule..... run into a wall after that. on-line help is not very...
|Check out our Excel VBA Resources|
As for on-line help, there's a file on the Office 97 disc called VEENOB3.hlp which doesn't load with the overall Office 97. (Why make things easy?) That file provides guidance on playing with Visual Basic in macros. Load it onto your hard drive and, if you intend to use it frequently, put a short-cut to the file on your desktop.
Tom is Correct as usuall.
For more info have a look @ Chip Pearson's
seems like I had to activate the desired Module_Name first before I could export/import and then Kill the file to remove after the import. Let me know if there is a better approach.
Here is the code.
'Copy the required macros over to new workbook
ThisWorkbook.VBProject.VBComponents _("Update_Summary").Export ("Module_Name")
Kill "Module_Name" ' Deletes macro file.