![]() |
get the program id of an excel application from the task manager
hi there,
i have this problem. i have an application written in delphi that fires up excel applications, so these applications get a PID from the system. what i need to do is to kill the excel applications by getting their PID from task manager!!!!!!!!!! how do i do that? thanks a lot nikos ------------------------------------------------ ~~ Message posted from http://www.ExcelTip.com/ ~~ View and post usenet messages directly from http://www.ExcelForum.com/ |
get the program id of an excel application from the task manager
On Tue, 14 Oct 2003 08:48:33 -0400, nikolaosk
wrote in microsoft.public.excel.programming: hi there, i have this problem. i have an application written in delphi that fires up excel applications, so these applications get a PID from the system. what i need to do is to kill the excel applications by getting their PID from task manager!!!!!!!!!! how do i do that? I don't know anything about Delphi's capabilities; there are a whole bunch of Delphi related newsgroups, i.a. at borland.public.delphi..., maybe they can provide a specific answer. But as Delphi can obviously spawn other processes, you could probably use TLIST and KILL from the NT Resource Kit, or pslist and pskill from the PsTools set <http://www.sysinternals.com/ntw2k/freeware/pstools.shtml. -- Michael Bednarek http://mcmbednarek.tripod.com/ "POST NO BILLS" |
get the program id of an excel application from the task manager
Don't know about delphi but on a WinXP or Win2k system you should be able to
use wmi. For example, this sub run in VBA would reveal the PID of a running instance of Excel. Sub getPID() For Each Process In GetObject("winmgmts:{impersonationLevel=impersonat e}").InstancesOf("Win32_pr ocess") If Process.Name = "EXCEL.EXE" Then MsgBox Process.Handle End If Next End Sub Steve "nikolaosk" wrote in message ... hi there, i have this problem. i have an application written in delphi that fires up excel applications, so these applications get a PID from the system. what i need to do is to kill the excel applications by getting their PID from task manager!!!!!!!!!! how do i do that? thanks a lot nikos ------------------------------------------------ ~~ Message posted from http://www.ExcelTip.com/ ~~ View and post usenet messages directly from http://www.ExcelForum.com/ |
All times are GMT +1. The time now is 12:29 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com