Click to See Complete Forum and Search --> : Kill excel process on Win 2k Server


mak123
10-07-2007, 10:02 PM
My application have a function, which allows create excel file and download it to user.
When I create new excel file, I start new instance of Excel application, and after file created, I kill this process.
This is my code:

System.Diagnostics.Process[] ps = System.Diagnostics.Process.GetProcesses();
foreach (System.Diagnostics.Process p in ps)
{
if (p.ProcessName.ToLower().Equals("excel"))
{
p.Kill();
}
}


It runs perfectly on Win XP (I tested in Localhost).
But when i deployed in Win 2k Server, it has exception "Access denied", and Excel process can't be kill.
Does Anyone have solution for this problems? Share with me plz
Thanks all guy