countrymeister
asked on
Killing a process from asp.net page
I have an ASP.NET page which invokes excel, and I intend to kill this excel process once the program has completed creating the reqd excel spreadsheet
I have the following code so far, when I try to kill the Excel process it states Access denied.
I am running the website under a given user account, which has administrative privileges.
My question is why can't I kill the process.
msBook.Close(false, msobjOpt, msobjOpt);
msBooks.Close();
msXL.Quit();
try
{
Marshal.ReleaseComObject(m sXL);
msXL = null;
GC.Collect();
}
catch (Exception ex)
{
}
//Kill older Excel processes
try
{
Process[] p = Process.GetProcessesByName ("EXCEL");
////kills all processes older than 15 minutes
for (int i = 0; i < p.Length; i++)
//if (p[i].StartTime.AddMinutes (2) < DateTime.Now)
p[i].Kill;
}
catch (Exception ex)
{
}
I have the following code so far, when I try to kill the Excel process it states Access denied.
I am running the website under a given user account, which has administrative privileges.
My question is why can't I kill the process.
msBook.Close(false, msobjOpt, msobjOpt);
msBooks.Close();
msXL.Quit();
try
{
Marshal.ReleaseComObject(m
msXL = null;
GC.Collect();
}
catch (Exception ex)
{
}
//Kill older Excel processes
try
{
Process[] p = Process.GetProcessesByName
////kills all processes older than 15 minutes
for (int i = 0; i < p.Length; i++)
//if (p[i].StartTime.AddMinutes
p[i].Kill;
}
catch (Exception ex)
{
}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.