Solved

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

Posted on 2006-06-16
9
239 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Independent Software Vendors: 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!

Question has a verified solution.

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

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…
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…
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…
Suggested Courses
Course of the Month8 days, 9 hours left to enroll

617 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