+ Reply to Thread
Results 1 to 7 of 7

Share VB Code

  1. #1
    Registered User
    Join Date
    07-28-2009
    Location
    Egypt
    MS-Off Ver
    Excel 2003
    Posts
    35

    Share VB Code

    Hi All ,

    if i have a code working fine and i need to share it with a collegue who will not be familar with editing VB editor , he just want to run my code on his excel sheet ....

    how to save it for him?.....i just found one extension i can get by exporting the code ".cls" , i think it will not help as i have tried and it faild .

    do we have a solution here to share the code without copy/paste?

  2. #2
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,372

    Re: Share VB Code

    You could save your file with the code as an .xla file and send it to him. He then would have to do Tools - Add ins - Browse to the file and install the add-in.

  3. #3
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Share VB Code

    If it is only one macro & only needded in one workbook, you can export the module. Transfer the *.bas to the other machine then import the .bas into the new workbook.

    In the original workbook's VB Editor right click on the module & choose Export. Note where it is exported to. Transfer the file to the other machine.

    In the other workbook open the editor, click on the VBA Project & choose Import. Select he file & it will import
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  4. #4
    Registered User
    Join Date
    07-28-2009
    Location
    Egypt
    MS-Off Ver
    Excel 2003
    Posts
    35

    Re: Share VB Code

    I tried by exporting to cls file and i have tried to import it again with a new file but it goes automatically to "Class Modules "

    originally it was a code written in "this workbook "

    if i run it it doesn't work ,

  5. #5
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Share VB Code

    Without seein your code it's hard to know what you are doing. Unless the code is actually a Class module it should export asa *.bas file.

  6. #6
    Registered User
    Join Date
    07-28-2009
    Location
    Egypt
    MS-Off Ver
    Excel 2003
    Posts
    35

    Re: Share VB Code

    Please Login or Register  to view this content.

  7. #7
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,441

    Re: Share VB Code

    Why is the code in the Thisworkbook object rather than a standard code module?

    If in a standard code module it will import/export as .bas file.
    Cheers
    Andy
    www.andypope.info

+ 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