首页 > 编程 > .NET > 正文

ASP.NET控制EXCEL,完全结束进程

2024-07-10 12:56:38
字体:
来源:转载
供稿:网友


  
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();
发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表