sorry, 标题200分不让给, 好气。

解决方案 »

  1.   

    办法到是有的
    在生成新的excel进程时,首先检测系统中已经运行中的excel进程,记录下它们的Ids
    在new个新的进程时,再次检测系统中已经运行中的excel进程,根据Ids可以判断出new的新excel进程的Id(这当然是有漏洞的,但一般情况下可以满足需要的)
    在Kill此进程
      

  2.   

    to  linaren(我的女朋友很漂亮):
    如果此时我已经起了excel 文档, 我怎么区别哪个进程就是我自己在程序中new 出来的?
      

  3.   

    http://blog.csdn.net/net_lover/archive/2004/09/14/103676.aspx
      

  4.   

    first of all, it is really a bad practice to use Office application on the server side, you should consider to redesign your app to avoid using office apps alltogetherINFO: Considerations for Server-Side Automation of Office
    http://support.microsoft.com/kb/257757but seeOffice application does not quit after automation from Visual Studio .NET client
    http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q317109
      

  5.   

    其实每次new excel之后,只要先设置excelapplicationclass.Quit();
    然后设excelclass = null;然后调用System.GC.Collect();
    好像就可以了,excel就没有了,反正记得GC一下
      

  6.   

    取进程StartTime,进行排队,比如保留最早的20个,其它的kill掉,个人认为excel.dll效率不高,直接用ole连接好点
      

  7.   

    to ==〉 jkflyfox(飞狐):多谢!thank you in advance 。
    to ==〉saucer(思归) :Yours advise is redesign ? My project is going to end . In any case , thank you.