Solved

Can we create .exe of a VBProject ?

Posted on 2004-03-24
7
264 Views
Last Modified: 2007-12-19
Hi,

     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()

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

  shell
"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.
0
Comment
Question by:jchandrababu_a
7 Comments
 
LVL 2

Accepted Solution

by:
NeTo earned 63 total points
ID: 10674342
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
0
 
LVL 11

Assisted Solution

by:Steiner
Steiner earned 62 total points
ID: 10674936
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"
   oThisProject.MakeCompiledFile
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.
0
 

Author Comment

by:jchandrababu_a
ID: 11443743
Hi, sorry for delay.. from last 2 months i am far away from net. Tell me how to split points...(I am new member).
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question