• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 281
  • Last Modified:

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.
2 Solutions
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).

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now