Hi,
I am working on a wpf application.
I am copying the data to excel sheet from database and saving the file and closing it once the operation is completed.
My question is:
How to stop the Process(EXCEL.EXE) in TaskManager->Processes ?
I have to delete the file after the operation is completed. I have written a pieceof code to stop the process in taskmanager, but didnt work..
private void EndExcelAPP(object obj)
{
try
{
System.Runtime.InteropServices.Marshal.ReleaseComObject(obj);
}
catch
{
}
finally
{
obj = null;
}
}
I cant delete it since using this too.. since it says the process is used by another process.
Please help me how to stop this process programatically in c# and delete the fiile ?
Thanks
Ramm