Hi,
I am starting a process which is an excel file.what it does is opens the excel file with the data content on the click of a button .now when i again click this or another button which uses this file m not able to delete it n gets the message file in use..so i found out another method whose code snippet is given below.First i start the process then i kill it if the process if already running..but the problem am facing is in Vista it gives the error when i try to kill the process saying the file is in use..In windows xp it works smoothly..
Please its urgent..waitign for reply..
thanx..
I am starting a process which is an excel file.what it does is opens the excel file with the data content on the click of a button .now when i again click this or another button which uses this file m not able to delete it n gets the message file in use..so i found out another method whose code snippet is given below.First i start the process then i kill it if the process if already running..but the problem am facing is in Vista it gives the error when i try to kill the process saying the file is in use..In windows xp it works smoothly..
Please its urgent..waitign for reply..
Code:
buton1click()
{
process = Process.Start(excelFilePath4Cal);//excelFilePath4Cal..its an excel file which has the data from the datagrid
}
buton2click()
{
if (process != null)
{
process.Kill();
}
}
thanx..
Comment