Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Anson ,
This is because sheet modules are class modules, but when you export them, the link into the actual sheet is lost. Importing them doesn't work as the sheet modules already exist, and so the import creates new class modules. You need a different approach here, either write the code directly, or put it in a text file and add the code form the text file. -- HTH Bob Phillips ... looking out across Poole Harbour to the Purbecks (remove nothere from the email address if mailing direct) "Anson" wrote in message ... I have wrote some codes to copy the modules and forms from the one workbook to another. Most of them worked fine, but the sheets modules were turned into class modules. I know I could manually enter the exact lines from the sheets and have the macro to wirte it, but is there a way to copy? This is the section that deals with coping modules: '--------------------------------------------------------------------------- ------ Dim NewBook As Workbook Dim VBComponent As VBIDE.VBComponent, ModName As String 'Copy Modules ModName = ThisWorkbook.Path & "\Merit Worksheet Code.txt" For Each VBComponent In ThisWorkbook.VBProject.VBComponents VBComponent.Export ModName NewBook.VBProject.VBComponents.Import ModName Kill ModName Next VBComponent |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
copy cell info to other sheets, other sheets dont contain all row. | Excel Worksheet Functions | |||
Codes needed to copy same one row from more than 300 Excel files | Excel Discussion (Misc queries) | |||
IRR: is there a quickest way? | Excel Worksheet Functions | |||
in VBA Sheets("mysheet").Copy Befo=Sheets(1) how do i get a reference to the newly created copy of this sheet? | Excel Worksheet Functions | |||
What is the quickest way to copy codes in Sheets? | Excel Programming |