ASP.NET控制EXCEL,完全結束進程 - 中國WEB開發者網絡 (http://www.webasp.net) -- 技術教程 (http://www.webasp.net/article/) --- ASP.NET控制EXCEL,完全結束進程 (http://www.webasp.net/article/18/17557.htm) |
| -- 作者:未知 -- 發佈日期: 2005-04-15 |
| 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,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控制存儲文件的類型 System.Runtime.InteropServices.Marshal.ReleaseComObject(ThisWb); ThisWb = null; ThisWbs.Close(); System.Runtime.InteropServices.Marshal.ReleaseComObject(ThisWbs); ThisWbs = null; System.Runtime.InteropServices.Marshal.ReleaseComObject(ThisApp); ThisApp = null; GC.Collect(); |
| webasp.net |