Excel.Application oExcel;
Excel.Workbook oBook;
Object oMissing = System.Reflection.Missing.Value;
oExcel = new Excel.Application();
oBook = oExcel.Workbooks.Add(oMissing);Excel.XlSaveAsAccessMode asm = Excel.XlSaveAsAccessMode.xlNoChange;
object Nothing = System.Reflection.Missing.Value;
string s_FullPath = System.Configuration.ConfigurationSettings.AppSettings["ExcelLocalPath"] + fileName + ".xls";oExcel.ActiveWorkbook.SaveAs(s_FullPath,Nothing,Nothing,Nothing,Nothing,Nothing,asm,Nothing,Nothing,Nothing,Nothing,Nothing);
oExcel.Workbooks.Close();
oExcel.Quit();
oExcel=null;
Excel.Workbook oBook;
Object oMissing = System.Reflection.Missing.Value;
oExcel = new Excel.Application();
oBook = oExcel.Workbooks.Add(oMissing);Excel.XlSaveAsAccessMode asm = Excel.XlSaveAsAccessMode.xlNoChange;
object Nothing = System.Reflection.Missing.Value;
string s_FullPath = System.Configuration.ConfigurationSettings.AppSettings["ExcelLocalPath"] + fileName + ".xls";oExcel.ActiveWorkbook.SaveAs(s_FullPath,Nothing,Nothing,Nothing,Nothing,Nothing,asm,Nothing,Nothing,Nothing,Nothing,Nothing);
oExcel.Workbooks.Close();
oExcel.Quit();
oExcel=null;
if( System.IO.File.Exists(s_FullPath ))
{
System.IO.File.Delete(s_FullPath ));
}