PDA

View Full Version : Can complete VBA code be exported to a different WKBK



Sam62
08-17-2008, 05:02 PM
I want hopefully, to export ALL modules, forms, objects etc in one workbook to another and if that can't be done than at least all modules and/or objects. This is so I can change code but leave the formulas/values etc in the main excel sheets. Basically it would need to delete all VBA code and copy, I guess from a text file to insert the new code, at least for modules and objects. Forms, I don't know how that can be done?
thanks for your help! scott

Bob Phillips
08-18-2008, 12:13 AM
Just export the modules, File>Export in the VBIDE, and import them in the other workbook.

Or open both workbooks, and drag-copy from one to the other project in the VBIDE.

Sam62
08-18-2008, 06:49 AM
That would take to long to do each of 152 macros, forms and objects since I think I can only do one at a time. Can a macro be coded to take line by line and save it to a text file and another macro be coded to read the text file and load all those lines back into VBA. Same with objects. But what about teh Forms section?

Jan Karel Pieterse
08-18-2008, 07:26 AM
Check out this tool:
http://www.jkp-ads.com/Download.asp#copyvbaproject