Solved

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

Posted on 2006-06-16
9
234 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
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no 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…
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…

803 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