I have to run Excel on a server and to kill the excel.exe process I am using taskkill.exe:
System.Diagnostics.Process.Start("taskkill.exe", "-im excel.exe /f");
My only problem is that if there is someone who is also using the server who is working on excel (It could happen) then their processes will be killed also. Is there anyway around this to only kill the excel files created by my code? Any help would be great. Thanks!