cancel
Showing results for 
Search instead for 
Did you mean: 

kill excel instance

PratikshaTiwari
Level 2
I am trying to Kill excel instance by its Process Name with Kill Process Action but seems i am failing to do so . Even after killing the instance the file says it is locked by user ? 

------------------------------
Pratiksha Tiwari
------------------------------
1 BEST ANSWER

Helpful Answers

EVIPUTI
MVP
The best way is to use MS Excel VBO and use the Exit and Close Instances actions. One can also use close all instances. 

For kill instance simply try "EXCEL" !


------------------------------
------------------------------
Vipul Tiwari
Senior Process Simplification and Optimization Designer(Solutions Architect)
Fidelity International
------------------------------
------------------------------
------------------------------ Vipul Tiwari Senior Process Simplification Developer Amazon ------------------------------

View answer in original post

4 REPLIES 4

EVIPUTI
MVP
The best way is to use MS Excel VBO and use the Exit and Close Instances actions. One can also use close all instances. 

For kill instance simply try "EXCEL" !


------------------------------
------------------------------
Vipul Tiwari
Senior Process Simplification and Optimization Designer(Solutions Architect)
Fidelity International
------------------------------
------------------------------
------------------------------ Vipul Tiwari Senior Process Simplification Developer Amazon ------------------------------

sumire
Level 9

Hi,

The "Kill Process" included in the "Utility - Environment" VBO is not able to completely kill the process.
https://docs.microsoft.com/en-us/dotnet/api/system.diagnostics.process.kill?view=netframework-4.8

19631.png



So I created an object to completely kill using code stage.
Input: ProcessName(text)
Output: nothing

Dim p As New System.Diagnostics.Process()

p.StartInfo.FileName = System.Environment.GetEnvironmentVariable("ComSpec")

p.StartInfo.Arguments = "/c taskkill /F /T /FI ""username eq %USERNAME%"" /IM " & ProcessName

p.StartInfo.UseShellExecute = false
p.StartInfo.CreateNoWindow = true

p.Start()
p.WaitForExit()
p.Close()​

You can kill Excel processes completely by giving "EXCEL.EXE" as the input argument "ProcessName".



------------------------------
Mitsuko
Asia/Tokyo
------------------------------
------------------------------
Mitsuko
Asia/Tokyo
------------------------------

@sumire This is useful , thanks for sharing.​

------------------------------
------------------------------
Vipul Tiwari
Senior Process Simplification and Optimization Designer(Solutions Architect)
Fidelity International
------------------------------
------------------------------
------------------------------ Vipul Tiwari Senior Process Simplification Developer Amazon ------------------------------

VedSengupta
Level 6
Hello Pratiksha,
Why not use close all instance action of MS Excel VBO?

------------------------------
------------------------------
Best Regards,
Ved Sengupta
RPA Developer
Deloitte India (Offices of the US)
Bangalore | INDIA
------------------------------
------------------------------
------------------------------ Best Regards, Ved Sengupta RPA Developer Deloitte India (Offices of the US) Bangalore | INDIA *If you find this post helpful mark it as best answer* ------------------------------