Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Copy a code module
I am using Excel 2003 with Windows XP.
Is there a way to copy code module (not just the code, but the entire module) and paste it into a specific destination file? If so could someone please paste example code illustrating how to do this? Thanks much in advance. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Copy a code module
You first need to export it out of the source project, and import
it in to the destination project. Something like the following should work: ThisWorkbook.VBProject.VBComponents("Module1").Exp ort _ Filename:="C:\Module1.bas" Workbooks("Book4.xls").VBProject.VBComponents.Impo rt _ Filename:="C:\Module1.bas" See www.cpearson.com/excel/vbe.htm for more details and example code. -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "quartz" wrote in message ... I am using Excel 2003 with Windows XP. Is there a way to copy code module (not just the code, but the entire module) and paste it into a specific destination file? If so could someone please paste example code illustrating how to do this? Thanks much in advance. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Copy a code module
Thanks Chip and regards.
Quartz "Chip Pearson" wrote: You first need to export it out of the source project, and import it in to the destination project. Something like the following should work: ThisWorkbook.VBProject.VBComponents("Module1").Exp ort _ Filename:="C:\Module1.bas" Workbooks("Book4.xls").VBProject.VBComponents.Impo rt _ Filename:="C:\Module1.bas" See www.cpearson.com/excel/vbe.htm for more details and example code. -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "quartz" wrote in message ... I am using Excel 2003 with Windows XP. Is there a way to copy code module (not just the code, but the entire module) and paste it into a specific destination file? If so could someone please paste example code illustrating how to do this? Thanks much in advance. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
code in module A to not execute a Worksheet_SelectionChange sub of another module | Excel Discussion (Misc queries) | |||
copying vba code to a standard code module | Excel Discussion (Misc queries) | |||
Sheet Code Module: copying code to | Excel Programming | |||
Copy module with code - amendment | Excel Programming | |||
Is it possible to copy a code module using VBA? | Excel Programming |