"The process cannot access the file" exception since Aspose.Cells 22.1

This one is easy to reproduce. Just create a new spreadsheet “Test.xlsx”, open it in Excel, and then execute the following code:

var workbook = new Workbook(@"C:\Users\Willem-Jan\Desktop\Test.xlsx");

We’re using Aspose.Cells for .NET Core. Until Aspose.Cells v21.12.0 it was possible to read Excel files while they are open in Excel. However, since Aspose.Cells v22.1.0 the following exception is thrown:

System.IO.IOException: ‘The process cannot access the file ‘C:\Users\Willem-Jan\Desktop\Test.xlsx’ because it is being used by another process.’

If you close Excel, there are no problems. Being able to read spreadsheets while they are open in Excel is an important feature for us.

Can you investigate this issue and provide a fix?

@perfectxl,

Yes, we know this behavior change and is expected behavior of the newer versions. We will provide details on it. We will get back to you soon.

@perfectxl,

Upon further investigations, we found this is due to changed behavior of System.IO (.NET) API. So, we decided to fix it (using appropriate measures) and will retain the older behavior/functionality as before. We have logged a ticket with an id “CELLSNET-50930” for your issue. We will look into it soon.

Once we figure it out or have some other updates, we will let you know.

@perfectxl,

This is to inform you that we have fixed your issue now. The fix will be included in (upcoming) next release (Aspose.Cells for .NET v22.5) which is scheduled to be released in the second week of May 2022. You will also be notified when the next version is released.

Thanks for the update.Glad it’s fixed in the next version.

@perfectxl,

You are welcome.

The issues you have found earlier (filed as CELLSNET-50930) have been fixed in this update. This message was posted using Bugs notification tool by johnson.shi