Excel.Application ThisApp = new Excel.ApplicationClass (); Excel.Workbooks ThisWbs = ThisApp.Workbooks; Excel.Workbook ThisWb = ThisWbs.Open ( "G: /demo.xls", Missing.Value, Missing.Value, Missing.Value Missing.Value, missing.value, missing.value, missing.value, missing.value, missing.value, missing.value, missing.value, missing.value, missing.value; thiswb.saveas "G: /HelloExcel.xml", Excel.XlFileFormat.xlXMLSpreadsheet, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Excel.XlSaveAsAccessMode.xlNoChange, Missing.Value, Missing.Value, Missing.Value, Missing .Value, missing.value;
//Excel.XlFileFormat.xlXMLSpreadsheet control type System.Runtime.InteropServices.Marshal.ReleaseComObject file is stored (ThisWb); ThisWb = null; ThisWbs.Close (); System.Runtime.InteropServices.Marshal.ReleaseComObject (ThisWbs); ThisWbs = NULL; System.Runtime.InteropServices.Marshal.releaseComobject (thisapp); Thisapp = null; gc.collect ();