Tech Support Guy banner
Status
Not open for further replies.

Solved: Excel: Copying module from one project to another

1K views 1 reply 1 participant last post by  jontro 
#1 ·
Having a problem calling a function that copies a working module from an existing workbook project to a newly created one. I found the routine that appears to do what I want it to on

Code:
http://www.cpearson.com/excel/vbe.aspx/
I set the references under tools for MS VBA Extensibitiy 5.3. as instructed. The function declaration is as follows:
Function CopyModule(Module1 As String, _
SMEM As VBIDE.VBProject, _
VBAProject As VBIDE.VBProject, _
OverwriteExisting As Boolean) As Boolean

I've substituted the ModuleName, FromVBAProject, and ToVBAProject name with my own as instructed.
Not quite sure what type of call function command is needed, e.g. arguments, etc. Also, is my substitution of names in the declaration correct?
Any help would appreciated. PD
 
#2 ·
Fixed the problem myself.:up:

Needed to include a couple of SET commands prior to calling the function and also added PUBLIC declarations for each of the called auguments.

The routine from cpearson is great, it was just working with VBA Extensibility commands that threw me at first.
 
Status
Not open for further replies.
You have insufficient privileges to reply here.
Top