Copy Macro to a new workbook

  • Thread starter Thread starter Saalim
  • Start date Start date
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.
 
I use Excel 2003. The time I run this code, I get "Compile error;
User-defined type not defined".

In VBA, you need to go to the Tools menu, choose References, and then
scroll down to "Microsoft Visual Basic For Applications Extensibility
Lbrary 5.3" and check that item. It is in that library that the types
for VBProject, VBComponent and similary objects are defined.

Cordially,
Chip Pearson
Microsoft MVP
Excel Product Group
Pearson Software Consulting, LLC
www.cpearson.com
(email on web site)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top