Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Can we create .exe of a VBProject ?

Posted on 2004-03-24
7
Medium Priority
?
277 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
3 Comments
 
LVL 2

Accepted Solution

by:
NeTo earned 252 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 248 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: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say 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

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
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.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
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…
Suggested Courses

824 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