Solved

Can we create .exe of a VBProject ?

Posted on 2004-03-24
7
254 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
Comment Utility
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
Comment Utility
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
Comment Utility
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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

728 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now