Can we create .exe of a VBProject ?


     I am doing Licenceing Project. It has number of VBProjects.
    Now, what i want is, I have one more project  , in which i am creating .exe files of other projects.
    But it is giving  error-File not found .

code is like this:

private Sub Form_Click()

"C:\ExFolder\Exe1.exe  C:\PjtFolder\Pjt1.vbp  \make", vbHide

"C:\ExFolder\Exe2.exe  C:\PjtFolder\Pjt2.vbp  \make", vbHide

End Sub

  Please reply me soon. wether is it possible or not ,If possible How ?.

   Thanks in Advance.
Who is Participating?
You may try:

Private Const SW_HIDE = 0
Private Const SW_SHOWNORMAL = 1
Private Declare Function ShellExecute _
    Lib "shell32.dll" Alias "ShellExecuteA" ( _
    ByVal hwnd As Long, _
    ByVal lpOperation As String, _
    ByVal lpFile As String, _
    ByVal lpParameters As String, _
    ByVal lpDirectory As String, _
    ByVal nShowCmd As Long) As Long

Private Sub Form_Click()
    ShellExecute 0&, vbNullString, "C:\ExFolder\Exe1.exe", vbNullString, "C:\PjtFolder\Pjt1.vbp  \make", SW_HIDE
    ShellExecute 0&, vbNullString, "C:\ExFolder\Exe2.exe", vbNullString, "C:\PjtFolder\Pjt2.vbp  \make", SW_HIDE
End Sub
You could use an add-in for the VB-IDE, that could look something like that:

Public VBInstance As VBIDE.VBE

Sub test()
   Dim oThisProject As VBIDE.VBProject
   ' Instead of ActiveVBProject you can pick any open project from the .projects - collection, maybe in a loop
   Set oThisProject = VBInstance.ActiveVBProject
   oThisProject.BuildFileName = "e:\test.exe"
End Sub

To create the addin you should use the template provided by the IDE (new Project - Add-in). Once you have it running and compiled you can now add this to another VB-session and start it like any other addin.
jchandrababu_aAuthor Commented:
Hi, sorry for delay.. from last 2 months i am far away from net. Tell me how to split points...(I am new member).
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.