How to compile to a stand alone executable


Written By TheVBProgramer - I've updated it some.

This Visual Basic Tutorial will show you how you can compile your VB6 code into an executable that cam be distributed to other computers easily. To make a "stand-alone" executable (.EXE) file, which will let you run your program from Windows (rather than having to open the project in the IDE and running it from there), perform the following steps:

  • With the project opened in the VB IDE, click the File menu and choose Make (Project Name):

    The Make Project dialog box will then appear, prompting you to give the executable a name (the default name is the name of the project). You may also change the folder where the executable will be saved, if desired. Once you click OK, VB will compile your program.

    At this point, you can close the project. If any of the project files need to be saved, VB will prompt you.

    In Windows, navigate to the folder where you saved the executable:

    Note that the default icon for a VB executable is the "VB form" icon. If desired, you can change this (before you compile). How to do this will be shown in a later tutorial.

    What has been illustrated in this tutorial will enable you to run the stand-alone executable on YOUR OWN SYSTEM. It does NOT guarantee that the executable will run on another computer. The computer on which the executable is to run must have the VB run-times installed, and any ActiveX control used by your program must also be registered on the target machine.

    Setting up the VB run-times and registering the other components required to run your VB program on another computer is accomplished by using an install utility such as the Package and Deployment Wizard which comes with Visual Studio / Visual Basic, or a third party product such as InstallShield.

    If you enjoyed this post, subscribe for updates (it's free)


I have a problem, u. I have compile exe for my vb project. but ican't run in the windows that didn't have vb. can you tell me a solutions asap. thank yo


my executable (.EXE) file in vb6.0 is not active . pls help me how to make it active



Run .exe to VB6 Program

I want to ask what is the problem with my code:

I've tried to search through the net and this code always appears

Private Sub Command1_Click()
Shell (App.Path & "Package\setup.exe")
End Sub

But I got this error:

Run-time Error 5
Invalid Procedure or Argument

Here's my email to those who know the solution, Thanks!

Please help

I get compile error at


I use vb6 and msaccess 2003. I have my code below.
Dim con As Connection
Dim com As Command
Dim rs As Recordset

Private Sub Form _Load()
Set con = New Connection
Set com = New Command
Set rs = New Recordset
con.connectionString = "Data Source=D:\Trials\StudentDetails\Student.mdb"
con.Provider = "Microsoft Jet 4.0 ole db Provider"
com.ActiveConnection = con
rs.Open "Select * from stud", con, adOpenDynamic, adLockOptimistic

    TxtName.Text = rs!Name

Pls Help

Can someone help me find error in the below code.thnxs.

Private Sub Command1_Click
Dim scores as Integer
scores = Text1 Text
score = Val scores

if scores = > 50 and < 99
Msg Box “You have Passed, “ Well Done! ! !

Else if scores = 100 then
Msg Box “100%, “ Great Work!

Else scores = > 0 and > 50 then
Msg Box = You Failed! !

End Sub

missing a "Then" in the 1st

missing a "Then" in the 1st "if" line
No "End If" preceding the End Sub
No Dim statement for "score" - you have one for scores but not for score
check your msgBox format - may be lissing parens or quotes.

Private Sub Command1_Click

Private Sub Command1_Click
Dim scores as Integer
scores = Text1.Text (text1 may be a text box control)
score = Val(scores)

if scores = > 50 and < 99 then
Msgbox “You have Passed, Well Done! ! !"
Else if scores = 100 then
Msgbox “100%, Great Work!"
Else scores = > 0 and > 50 then
Msgbox = You Failed! !
End Sub


Private Sub Command1_Click
Dim scores as Integer
scores = Text1.Text (text1 may be a text box control)
score = Val(scores)

if scores => 50 and scores < 99 then
Msgbox ("You have Passed, Well Done! ! !")
Elseif scores = 100 then
Msgbox (“100%, Great Work!")
Else scores => 0 and scores > 50 then
Msgbox ("You Failed! !")
End Sub


I think the error is on line 3
scores = Text1 Text instead of
scores = Text1.Text
and probably line 4


sir i crated a vb program in vb6, i copyed this exe files and database to other computer , i have no vb6 setup file , how to run my program with out install vb6 , please you sent my reply am waiting for your reply thanks

Please help

I use vb6, but my make project1.exe is greyed out!!!

This is quite right that this

This is quite right that this tutorial is for the beginners, but the title of the tutorial should not be "Creating Stand-Alone Exe", instead it should be "Compiling your source code to make an Exe". This would rather be better explanation. Because a Stand-Alone Exe means there is no any Dependency of any file. The Finally made Exe must be quite capable enough to cope supporting all the functions and subroutines that are available in DLLs. There are also a number of DLL2LIB convertor programs by which this task can be achieved.

Visual Basic 6.0

Sir, please after compiling my project, i find it difficult to package it, how can i package my project?


I use VB6.0 and "Make Project1.exe" my gray how to fix it?

question on what kind of error did i encounter/how to fix it

what kind of error did i encounter if the msg box appears,

Compile Error:

Invalid qualifier

and when i click ok, it refers to this line, particularly the "scrlBar" statement

If RefNo = "-" Then
scrlBar.Visible = False
lblRept(0) = ""
lblRept(1) = ""
txtRept(1) = ""
txtRept(2) = ""
LoadTransOrder 1
Label(63) = "Record: 0 of " & .RecordCount
scrlBar.Visible = True
.Filter = "[ref_no] LIKE '" & RefNo & "'"
lblRept(0) = .Fields![prep_date]
lblRept(1) = .Fields![prep_by]
txtRept(1) = .Fields![dept]
txtRept(2) = .Fields![note_by]
LoadTransOrder 0
LoadTRitems .Fields![ref_no]
End If

Stand-alone EXE

I used to own VB-3 Standard Edition and it had two compiler options: one option kept the exe and dll separate while the second option produced a completely stand-alone executable. The way it did that was by making vbrun300.dll a part of the exe during the compile. Supposedly there was a slight performance hit when using that method and it's a fact that the single exe was larger than the sum of the exe and dll, but you ended up with one exe and zero worries about 'missing runtime file' complaints from anyone who might use your program. I currently own VB-6 Enterprise and have not been able to find the single-file compiler option. Bill Gates must have decided it was too much of a good thing and eliminated it.

make project1.exe


your article was helpful to understand the error i was facing, just one question im using vb 6 on win 7, but i dont have the make project1.exe option in the file menu.
i did run vb6 in the win xp compatibility mode as well, the option make project1.exe is grayed out.

please help

embedd exe in vb

hjlfhow to embedd an exe in vb6.
like we are adding .dll or ocx file.


One of the best tutorials I've come across, especially for beginners. Info not available elsewhere. Thanks.



bad title

This article could be useful to some beginners but for the love of god, make the name of your article reflect what you are going to discuss! I was expecting steps to create a "stand alone" exe (just like it says..) not how to compile and make an exe!!!!!!!!!! waste of time this was.


You call this "Stand Alone"
you jerk


i tried your tecnics in compiling project, it runs but my program won't run to the other computer. i just want to use my program without other applications to install such as vb. i want my program just stand alone.

pisti sheyt

I thought this thread will be telling me how to put all dependency files on my exe to make it "STAND ALONE". I was wrong


i want to know the difference between active EXE control and active XDLL control.......................

Make .exe files

Would it be asking too much for someone to post details of an alternative to the now defunct Fusion V3 which did exactly what some of us thought this thread was about?

Sure some beginners would need the level of step by step in this article, but for the slightly more advanced, how do I make a stand alone .exe which can be run on a target PC without having to run the vb5 created setup.exe

make exe

Actually this tutorial helped me a lot, am new to VB and was completely lost thanks

Make exe

Not dumb at all - I couldn't find this anywhere in the "help" or in the menu. Everything else we ever do is Create not Make



This is one of the nice prgrams i have ever comeacross.

useless article

This is by far the stupidest article here. If you are using vb6 and have not figured out how to create an exe from your project then you need to give up. When I saw the title of stand alone exe I was thinking something like .net where you can put the exe on another computer and it works without using install programs. That article did nothing but tell us what is in the MS help. But if you could not figure out how to MAKE and EXE then you need to give up programming.

Reply to "useless article"

[edited for cuss words - (a little more graphic words were used originally)]
get over yourself
people who are totally new to anything to do with programming or have never been confronted with this sort of IDE mightn't know how to do that.
instead of saying: "your useless i didn't help me get a job write better tutorials" how about you go think about the fact that other less gifted people might not know how to do that, and that you are a total...