我搜过了,没有发现好的解决方法,有一个方法是可行的,就是搜索excel进程杀掉,但这样分布式应用会出问题
用owc吧

解决方案 »

  1.   

    我也顶。
    我的理解是开启的应用Quit()好像不起作用。
      

  2.   

    搜索一下老帖子,我的在Excel XP下能释放:
    public void DestoryExcel()
    {
    oBook.Close( false, null, null );
    oExcel.Workbooks.Close();
    oExcel.Quit();
    System.Runtime.InteropServices.Marshal.ReleaseComObject( oRange );
    System.Runtime.InteropServices.Marshal.ReleaseComObject( oWorkSheet );
    System.Runtime.InteropServices.Marshal.ReleaseComObject( oSheet );
    System.Runtime.InteropServices.Marshal.ReleaseComObject( oBook );
    System.Runtime.InteropServices.Marshal.ReleaseComObject( oExcel );
    oRange = null;
    oWorkSheet = null;
    oSheet = null;
    oBook = null;
    oMissing = null;
    oExcel = null;
    GC.Collect();
    }
      

  3.   

    windows2000是不能释放。
    用Process的Kill()方法
    http://www.eggheadcafe.com/articles/20011021.asp