+ Reply to Thread
Results 1 to 5 of 5

How to copy module form one workbook to another

  1. #1
    Registered User
    Join Date
    12-13-2005
    Posts
    6

    How to copy module form one workbook to another

    Hi,

    How do i copy modules form one workbook to another through vba.

    Regards,
    Deepak

  2. #2
    Dave Peterson
    Guest

    Re: How to copy module form one workbook to another

    Check out Chip Pearson's site:
    http://cpearson.com/excel/vbe.htm

    deepakmehta wrote:
    >
    > Hi,
    >
    > How do i copy modules form one workbook to another through vba.
    >
    > Regards,
    > Deepak
    >
    > --
    > deepakmehta
    > ------------------------------------------------------------------------
    > deepakmehta's Profile: http://www.excelforum.com/member.php...o&userid=29609
    > View this thread: http://www.excelforum.com/showthread...hreadid=539876


    --

    Dave Peterson

  3. #3
    Registered User
    Join Date
    12-13-2005
    Posts
    6

    How to copy module form one workbook to another

    I have tried that but i am still unsuccessful...... help !!

    What i am doing is >> making a xl. file thrugh vba code in Main.xl and then saving it as User.xl, now i need to copy one of the modules form the Main.xl to the User.xl.


    Regards,
    Deepak

  4. #4
    Dave Peterson
    Guest

    Re: How to copy module form one workbook to another

    Store your code as .bas files and use the procedures at Chip's site to import
    them.

    deepakmehta wrote:
    >
    > I have tried that but i am still unsuccessful...... help !!
    >
    > What i am doing is >> making a xl. file thrugh vba code in Main.xl and
    > then saving it as User.xl, now i need to copy one of the modules form
    > the Main.xl to the User.xl.
    >
    > Regards,
    > Deepak
    >
    > --
    > deepakmehta
    > ------------------------------------------------------------------------
    > deepakmehta's Profile: http://www.excelforum.com/member.php...o&userid=29609
    > View this thread: http://www.excelforum.com/showthread...hreadid=539876


    --

    Dave Peterson

  5. #5
    David
    Guest

    Re: How to copy module form one workbook to another

    deepakmehta wrote

    > What i am doing is >> making a xl. file thrugh vba code in Main.xl and
    > then saving it as User.xl, now i need to copy one of the modules form
    > the Main.xl to the User.xl.
    >


    Study the code on that site that looks like this:
    With ThisWorkbook
    FName = .Path & "\code.txt"
    ..VBProject.VBComponents("Module2").Export FName
    End With
    ActiveWorkbook.VBProject.VBComponents.Import FName
    Kill FName


    --
    David

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1