Solved

Opening other programs

Posted on 1998-09-14
1
139 Views
Last Modified: 2012-05-04
How do you open another program via VB5?  like if you want to open Windows Explorer when you click a command button.  Thanks mucho!

   The Gringo
0
Comment
Question by:GringoHombre
1 Comment
 
LVL 2

Accepted Solution

by:
wj7ster earned 40 total points
Comment Utility
Use the ShellExecute API:

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

Then Pass the path to the directory you want to open as a parameter:

Say you want to open the folder 'C:\' then

Dim lRet As Long

lRet = ShellExecute (Me.hwnd, vbNullString, "C:\", vbNullString, CurDir, 1)


0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
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 process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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…

771 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

11 Experts available now in Live!

Get 1:1 Help Now