html5中文学习网

您的位置: 首页 > 网络编程 > ASP.NET » 正文

ASP.NET控制EXCEL,完全结束进程_.NET教程_编程技术

[ ] 已经帮助:人解决问题
asp.net|excel|进程|控制
  
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();
9cDHTML5中文学习网 - HTML5先行者学习网
9cDHTML5中文学习网 - HTML5先行者学习网
(责任编辑:)
推荐书籍
推荐资讯
关于HTML5先行者 - 联系我们 - 广告服务 - 友情链接 - 网站地图 - 版权声明 - 人才招聘 - 帮助