+ Reply to Thread
Results 1 to 5 of 5

Creating a executable VB program

  1. #1
    Registered User
    Join Date
    09-07-2010
    Location
    Allendale, MI
    MS-Off Ver
    Excel 2003
    Posts
    8

    Creating a executable VB program

    I have a macro that runs in excel. I would like to be able to run this as an executable.

    Right now the macro reads off values in the excel file and creates a text file capable of importing into another program for formatting reasons. Here is what I would like to do.

    I would like to create an executable that when ran, does the following

    1. Opens or simply reads the created excel file through the Microsoft common dialog
    2. Performs the code written to read the values in the excel file and create the text file.

    Basically I need a way of associating the macro code in a stand alone executable environment. I can get the common dialog interface to run and select the excel file, but I don't know how to get the code to work outside of the macro.

    example code from part of the macro.

    Range("C2").Select
    topmask = ActiveCell.Value

    Obviously the macro knows what excel file, sheet, ect I am referencing since it is opened with the excel file. I need help associating the file chosen through the dialog with this code. Help!!!!

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Creating a executable VB program

    Hello fabb2004,

    While it is possible to create an executable VB file, you can not do the same in VBA. A VBA module is a text file that is interpreted by the Application (Excel, Word, Access, or Power Point) by calling the VBIDE (Visual Basic Integrated Development Environment).

    If you want to create a stand alone executable, you need to use another language. If you have VB you can use that. Some other possibilities would be VB.net, or C#. Another option to evaluate might be to create an Add-In. This would allow your macro to be used by any open workbook.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Registered User
    Join Date
    09-07-2010
    Location
    Allendale, MI
    MS-Off Ver
    Excel 2003
    Posts
    8

    Re: Creating a executable VB program

    I have VB 6.0, but I don't know how to get what I have written as a macro working as an executable? Any help with VB 6.0?

    Thanks!

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

    Re: Creating a executable VB program

    Cheers
    Andy
    www.andypope.info

  5. #5
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: Creating a executable VB program

    What's the use of an executable that works exclusively with Excel-workbooks ?
    I fear you asked for a solution without realising that you'd better formulated a 'problem'/goal.



+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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