Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 226
Default Export Code Module

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default Export Code Module

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.

--
Rick (MVP - Excel)


"Roger" wrote in message
...
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


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 226
Default Export Code Module

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

"Rick Rothstein" wrote:

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.

--
Rick (MVP - Excel)


"Roger" wrote in message
...
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



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Export Code Module

See cpearson website

http://www.cpearson.com/Excel/vbe.aspx

The macros that copy from one workbook to another exports the VBA code into
a BAS file (text). You want to save the BAS files. Yo don't need to use the
import code.

"Roger" wrote:

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

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 226
Default Export Code Module

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").Expo rt
Filename:="C:\F&I\Mod1,bas"



"Joel" wrote:

See cpearson website

http://www.cpearson.com/Excel/vbe.aspx

The macros that copy from one workbook to another exports the VBA code into
a BAS file (text). You want to save the BAS files. Yo don't need to use the
import code.

"Roger" wrote:

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



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Export Code Module

Hi,

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

"Roger" wrote:

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").Expo rt
Filename:="C:\F&I\Mod1,bas"



"Joel" wrote:

See cpearson website

http://www.cpearson.com/Excel/vbe.aspx

The macros that copy from one workbook to another exports the VBA code into
a BAS file (text). You want to save the BAS files. Yo don't need to use the
import code.

"Roger" wrote:

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

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Export a module to .bas file - No Password Excel_Newb Excel Programming 5 July 21st 09 11:37 PM
VBA code in one Module referencing Public Variables Declared inanother Module failing Khurram Excel Programming 5 March 11th 09 11:01 PM
code in module A to not execute a Worksheet_SelectionChange sub of another module Jack Sons Excel Discussion (Misc queries) 4 December 11th 05 11:52 PM
Run worksheet module code from workbook module? keithb Excel Programming 1 August 14th 05 04:04 AM
Export module Todd Huttenstine Excel Programming 1 May 11th 04 07:08 PM


All times are GMT +1. The time now is 10:16 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"