Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Closing a program which was opened with shellexecute

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 274
Default Closing a program which was opened with shellexecute

Hi JonT,

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

Application.Quit

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

Regards

Michael
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Closing a program MarkS Excel Programming 3 March 19th 07 02:42 AM
Closing Files Opened Using the FileToOpen D Zandveld Excel Programming 2 February 21st 07 08:51 AM
Closing a workbook after it has opened another belkingold Excel Programming 5 October 30th 06 07:51 PM
Can a file know if opened using a program? quartz[_2_] Excel Programming 1 September 21st 05 04:15 AM
closing opened workbook/app in memory Alex Excel Programming 0 January 26th 05 09:35 PM


All times are GMT +1. The time now is 08:10 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"