Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
I want to kill "EXCEL.EXE" Process by Macro.
Could you pelase share VB Script (.VBS).
Thanks,
Nihhal.
I think this should terminate the EXCEL.EXE:
Sub TerminateProcess
Dim Process
For Each Process In GetObject("winmgmts:").ExecQuery("Select Name from Win32_Process Where Name = 'EXCEL.EXE'")
Process.Terminate
Next
End Sub
hope this helps!
If possible try to terminate this process before (after excel finished the task to which it was created). If you really need to go further with this approach take a look here: Re: How to create kill QV task which you could adapt from qlik to excel.
- Marcus
I think this should terminate the EXCEL.EXE:
Sub TerminateProcess
Dim Process
For Each Process In GetObject("winmgmts:").ExecQuery("Select Name from Win32_Process Where Name = 'EXCEL.EXE'")
Process.Terminate
Next
End Sub
hope this helps!
Thank you.
'1) User Define Function in VBS
Sub TerminateProcess
Dim Process
For Each Process In GetObject("winmgmts:").ExecQuery("Select Name from Win32_Process Where Name = 'EXCEL.EXE'")
Process.Terminate
Next
End Sub
'2) Call when yoiu required for end process
TerminateProcess
Note : it will lost all un saved data