Link to home
Start Free TrialLog in
Avatar of Lee5
Lee5

asked on

Opening a file or an application

I now use:

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

with -
ShellExecute Me.hwnd, "Open", Link, 0&, 0&, 5

to open an internet site or to bring up a file in an application.  How can I change this to only open applications in my computer?
Avatar of Erick37
Erick37
Flag of United States of America image

If you only want to run an application you can use the Shell command:

Call Shell("c:\windows\notepad.exe", vbNormalFocus)
ASKER CERTIFIED SOLUTION
Avatar of phairat2000
phairat2000

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Hmmmm...
Avatar of sonalchouhan
sonalchouhan

use shell

dim retval

retval = shell("C:\Program Files\Internet Explorer\Iexplore.exe")

all the best