应将ApplicationClass.Quit();  放在所有的

System.Runtime.InteropServices.Marshal.ReleaseComObject(xlApp);后面,如:


  if (xlApp != null)
                {
                    System.Runtime.InteropServices.Marshal.ReleaseComObject(xlApp);
                    xlApp = null;
                }

                workBook.Close(falsenullnull);
                xlApp.Workbooks.Close();
                xlApp.Quit();  //自动打开Excel,抛异常

 

 

相关文章:

  • 2021-07-28
  • 2021-05-05
  • 2021-10-17
  • 2022-12-23
  • 2021-08-06
  • 2021-11-18
  • 2021-06-12
  • 2021-12-08
猜你喜欢
  • 2022-12-23
  • 2021-10-08
  • 2021-11-26
  • 2021-05-25
  • 2022-12-23
  • 2022-01-16
  • 2022-12-23
相关资源
相似解决方案