Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Chip Pearson's website has great code for copying modules between
projects, but can anyone tell me how to tweak the code so that I can copy modules from a folder or directory. Here is the code for the unenlightened: Sub CopyAllModules() Dim FName As String Dim VBComp As VBIDE.VBComponent With Workbooks("Book2") FName = .Path & "\code.txt" If Dir(FName) < "" Then Kill FName End If For Each VBComp In .VBProject.VBComponents If VBComp.Type < vbext_ct_Document Then VBComp.Export FName Workbooks("book1").VBProject.VBComponents.Import FName Kill FName End If Next VBComp End With End Sub I'm guessing I need to change the first line, "With Workbooks...", but I don't know the syntax to fix it. Thanks to all. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Copying all files in a folder to new folder | Excel Discussion (Misc queries) | |||
can excel links be somehow relative to folder structure? | Excel Discussion (Misc queries) | |||
Need code to save file to new folder, erase from old folder | Excel Discussion (Misc queries) | |||
Password protection of Folder | Excel Discussion (Misc queries) | |||
What is folder OLK7 and where can I find it? | Excel Discussion (Misc queries) |