Export Code Module

R

Roger

Could someone give me an example of the code required to export a code module
to a folder (for Back up)

I can export from 1 file to another - but am struggling with the above

Assume the workbook that I want to export from is called "File1"
the module I want to export is called "Mod1"
the back up directory is called "C:\F&I\Backup|"

thankyou in anticipation
 
R

Rick Rothstein

I'm not sure I understand why you are asking for code to do this... find the
module name in the Project list, right-click it and select Export File from
the popup menu that appears... you can choose whatever destination you want
for the exported copy of the module and, if desired, you can even change the
name for the exported file. Actually, you can do this for any of the sheets,
modules or even UserForms listed in the Project window.
 
R

Roger

I know how to import/export modules manually - if I update my code in my
master file - I then distibute it to end users - doing things manually is
always subject to human error - if you write code & check that it works - it
always works with no human error - that is why i made the request
 
R

Roger

Joel - thanks - i butchered a section of Chips code - the solution is below
and now you see it, its remarkably simple - thanks again

Activeworkbook.VBProject.VBComponents("Mod1").Export
Filename:="C:\F&I\Mod1,bas"
 
M

mark ivanowski

Hi,

Do you have you final code that works?
I've been trying but it returns error messages all over the code.
thanks
 

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

Top