Solved

How to open an executable from a button within a VB Appl

Posted on 2006-06-16
9
236 Views
Last Modified: 2010-04-30
I'm sure this is quite simple, but in my quick searches, I can't find a solution.

I am new to Visual Basic, although I'm proficient with VBA within MS Access.

I am attempting to create a very small VB program that opens a small window with some verbiage and a button.  The button should simply open up an executable application on the user's PC.

I already have the form (project) created and a button, but I can't figure out the VB code to perform this simple action.

The file is: C:\QMIS\QmisUI.exe

Thanks!
0
Comment
Question by:bkapla1
  • 6
  • 3
9 Comments
 
LVL 5

Expert Comment

by:lunchbyte
ID: 16921615
Shell

try Shell "C:\QMIS\QmisUI.exe"
0
 
LVL 5

Expert Comment

by:lunchbyte
ID: 16921621

' normal size and gives it the focus.
Dim RetVal
RetVal = Shell("C:\WINDOWS\CALC.EXE", 1)   ' Run Calculator.

Here is a better exmaple.
0
 
LVL 5

Expert Comment

by:lunchbyte
ID: 16921647
The regular shell will launch your program and continue on with the codes in your VB6. This API will launch your program and wait until that program is close then continue on with the codes in VB6.

http://freevbcode.com/ShowCode.Asp?ID=3441
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:bkapla1
ID: 16921662
Hmmm... still didn't work, I even tried your specific example of the calc.

The error is SecurityException was unhandled.... Request for permission of type 'System.Security.Permissions.SecurityPermission, mscorlib, Version 2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 failed

I literally just installed VisualStudio express onto my PC this morning, so this is also the first time I've used it.
0
 
LVL 5

Expert Comment

by:lunchbyte
ID: 16921668
LOL, you may want to post your question in vb.net. The code I gave you is for VB.

Someone who knows VB.net may come along but you need to post your question there for better help.

http://www.experts-exchange.com/Programming/Programming_Languages/Dot_Net/VB_DOT_NET/
0
 
LVL 5

Accepted Solution

by:
lunchbyte earned 500 total points
ID: 16921694
0
 

Author Comment

by:bkapla1
ID: 16921699
Ahh... maybe that's the ticket... too many "types" of VB out there

I actually don't care what type of application it is as my goal is to simply have a quick and easy application on the user's desktop that will perform this function.

If I want to use straight VB vs. VB.net, how to I create a VB application (what development tool do I need to do this)?
0
 
LVL 5

Expert Comment

by:lunchbyte
ID: 16921717
You cannot buy VB6 anymore because it’s an old language and VB.Net is the next generation.  You already have Visual Studio express (free right) so you’re best bet is to start from there not the old language because it is different in many ways.
0
 

Author Comment

by:bkapla1
ID: 16921724
Ok, I'll keep trying.

Thanks for your help and clarification that Visual Studio uses VB.Net, not just VB... I'll get it straight!!

I'll give you the points for pointing me in the right direction!

Thanks!
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone 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

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…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
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 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…

756 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