EXCEl释放

            WB.Save();
            WB.Close(Type.Missing, Type.Missing, Type.Missing);
            appold.Quit();  //应用程序推出,但是进程还在运行


            appnewbook.Save();
            appnewbook.Close(Type.Missing, Type.Missing, Type.Missing);
            appnew.Quit();  //应用程序推出,但是进程还在运行

            System.Runtime.InteropServices.Marshal.ReleaseComObject(worksheet);
            System.Runtime.InteropServices.Marshal.ReleaseComObject(appnewsheet);
            System.Runtime.InteropServices.Marshal.ReleaseComObject(WB);
            System.Runtime.InteropServices.Marshal.ReleaseComObject(appnewbook);
            System.Runtime.InteropServices.Marshal.ReleaseComObject(appold);
            System.Runtime.InteropServices.Marshal.ReleaseComObject(appnew);

 

posted @ 2013-01-10 11:08  落冰  阅读(178)  评论(0编辑  收藏  举报