All articles(网络文学目录) All Pictures(图片目录) All Softwares(软件目录)

 
Excel在.Net下驻留内存的解决方法_.net资料_编程技术

Writer: aaa Article type: Programming skills(编程技巧) Time: 2013/12/15 8:42:37 Browse times: 374 Comment times: 0

Excel在.Net下驻留内存的解决方法_.net资料_编程技术


Head photo

Go homepage
Upload pictures
Write articles

Excel在.Net下驻留内存的解决方法_.net资料_编程技术-你的首页-uuhomepage.com

  这段时间在VS 2003 的WebForm 方式下对Excel 进行操作,遇到一个最为头疼的问题就是对Excel操作完毕后Excel不能够正常关闭,系统退出后,Excel总是驻留在内存中。但是这段代码放到WinForm的程序中又没有问题。在网上进行了查找也没有找到有效可行的办法。经过无数次的尝试,终于解决如下:

  原来书写如下:

  private Excel.Application m_app;
  private Excel.Workbook m_workbook;
  this.m_app = new Excel.ApplicationClass();
  this.m_app.DisplayAlerts = false;
  this.m_workbook = this.m_app.Workbooks.Open(sFilePath, 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 );




There are 0 records,
Comment:
Must be registered users to comment(必须是注册用户才能发表评论)

Disclaimer Privacy Policy About us Site Map
Copyright ©2011-
uuhomepage.com, Inc. All rights reserved.