Thanks a lot for the link.
I use Excel 2003. The time I run this code, I get "Compile error;
User-defined type not defined".
I think I have declared all the variables correctly.
The code stops at the first line:
Function CopyModule(ModuleName As String, _
FromVBProject As VBIDE.VBProject, _
ToVBProject As VBIDE.VBProject, _
OverwriteExisting As Boolean) As Boolean
Please help.