Share via


Visual Basic Concepts

Making and Running an Executable File

You can make an executable file (.exe) from Visual Basic using the following procedure.

To make an executable file in Visual Basic

  1. From the File menu, choose Make projectname .exe where projectname is the application name for the project.

  2. Type a file name, or browse through the directories and select an existing file name to overwrite an existing executable with a newer version.

  3. By clicking the Options button, you can also specify a number of version-specific details about the executable file in the Project Properties dialog box.

  4. If you want to modify the version number of the project, set the appropriate Major, Minor, and Revision numbers. Selecting Auto Increment will automatically step the Revision number each time you run the Make projectname .exe command for this project.

  5. To specify a new name for the application, under Application, type a new name in the Title box. If you want to specify a new icon, choose one from the list.

  6. You can also enter version-specific commentary on a variety of issues under the Version Information box (comments, company name, trademark and copyright information, and so on) by selecting a topic from the list box and entering information in the text box.

  7. Choose OK to close the Project Properties dialog box, and then choose OK in the Make appname .exe dialog box to compile and link the executable file.

You can run the executable file like any other Windows-based application: double-click the icon for the executable file.

Note   Building an executable file from the command line in a DOS session can be useful when you want to compile a project programmatically. In a batch file, type:

Vb6 /makeprojectname**[.vbp] [exename]**

For projectname, type the name of the project file. Use the variable exename to rename the resulting executable file.

Conditional Compilation

Conditional compilation lets you selectively compile certain parts of the program. You can include specific features of your program in different versions, such as changing the date and currency display filters for an application distributed in several different languages.

For More Information   To learn more about conditional compilation, see "Using Conditional Compilation" in "More About Programming."