|
|
用System.Runtime.InteropServices.Marshal.ReleaseComObject(MyApp);
System.Runtime.InteropServices.Marshal.ReleaseComObject(workbooks);
System.Runtime.InteropServices.Marshal.ReleaseComObject(mysheet);
System.Runtime.InteropServices.Marshal.ReleaseComObject(MyBook);
System.Runtime.InteropServices.Marshal.ReleaseComObject(MySheets);
替换
10楼里面的
MyApp.Workbooks.Close();
MyApp.Quit();
就可以释放 excel 进程了 |
|