Closing a program which was opened with shellexecute

J

JonT

Good morning ,

I use the following code to open another program - does anybody the
corresponding code to close it again? Would really be most grateful
for any help - I've been looking for ages . . .

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

Sub openProg()
Dim URL As String
URL = "C:\Program Files\....exe"
Call ShellExecute(0&, vbNullString, URL, vbNullString,
vbNullString, vbNormalFocus)

End Sub

Thanks very much in advance for any help you may be able to give.

JonT
 
M

michael.beckinsale

Hi JonT,

How about something like......................

Application.Quit

...........you may have to qualify the application.

Regards

Michael
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top