Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Copy UserForms and Modules to another workbook 1

Status
Not open for further replies.

mveera

Programmer
Nov 6, 2002
81
US
Hi,

Is it possible to copy the UserForms and Modules created in Workbook to another workbook.

Thanks
Veera
 
Yes. An easy way to handle it would be to export it from one workbook (to a temporary file), then import into the other one. Something like:

ActiveWorkbook.VBProject.VBComponents("Module1").Export "c:\temp\module1.bas"
OtherWorkbook.VBProject.VBComponents.import "c:\temp\module1.bas"



Rob
[flowerface]
 
Thanks Rob.

I would like to know if it is possible to export all the forms and modules at one shot rather doing it one at time and then import separately.

Thanks
Veera
 
It's fairly easy to do with code modules, but I don't know how to do it with userforms. Maybe somebody else [smarty] will jump in with a solution... Rob
[flowerface]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top