05-03-2012, 01:13 PM
Hi,
You can use the below function. This will kill any process runing in task manager. All u need to do is to pass the Program name.
Regards,
Ankesh
You can use the below function. This will kill any process runing in task manager. All u need to do is to pass the Program name.
Code:
Public Function General_CloseProcess(strProgramName)
Dim objshell
Set objshell=CreateObject("WScript.Shell")
objshell.Run "TASKKILL /F /IM "& strProgramName
Set objshell=nothing
End Function
'If want to close excel
Call General_CloseProcess("Excel.EXE")
'Killing word
Call General_CloseProcess("WINWORD.exe")
Regards,
Ankesh