Closing an Excel Workbook

前端 未结 5 745
無奈伤痛
無奈伤痛 2021-01-13 00:34

I have a bit of code that opens an xls workbook;

Excel.Workbooks workBooks;
workBooks = excelApp.Workbooks;
workbook = workBooks.Open(sourceFilePath + source         


        
5条回答
  •  囚心锁ツ
    2021-01-13 00:52

    Have you considered the fact that the system might still be in the process of saving the file when you attempt to close it? I'm just saying, to be sure add a delay(Thread.Sleep(1000) in C# for example) before the close to see if this is the problem.

提交回复
热议问题