I have to 2 process excel. For example:
1) example1.xlsx 2) example2.xlsx
How to kill first \"example1.xlsx\"?
I use this code:
f
Copy and paste this. Its done!
System.Diagnostics.Process[] process = System.Diagnostics.Process.GetProcessesByName("Excel"); foreach (System.Diagnostics.Process p in process) { if (!string.IsNullOrEmpty(p.ProcessName)) { try { p.Kill(); } catch { } } }