Hello, I’d like to report a bug we’re seeing when attempting to save a workbook to disk using Aspose.Cells for .NET.
Summary
If a workbook is opened and then cloned in memory using Workbook.Copy()
, saving the cloned workbook object to disk with Workbook.Save()
will not work; the call will freeze and block forever, leaving a corrupt file on disk. This only occurs with some workbooks, and the bug seems to have been introduced in Aspose.Cells 21.1.0.
Detailed Reproduction
Workbook: AZZ AZZ US.zip (535.8 KB)
I can reliably reproduce the issue on Aspose.Cells 21.4.0 with this code:
// Load workbook and save a copy to disk, this succeeds
var wb = new Aspose.Cells.Workbook(@"C:\scratch\AZZ AZZ US.xlsx");
wb.Save(@"C:\scratch\output1.xlsx", Aspose.Cells.SaveFormat.Auto);
// Clone the original workbook in memory
var clonedWb = new Aspose.Cells.Workbook();
clonedWb.Copy(wb);
// Attempt to save the cloned workbook to disk, this call blocks forever and leaves a corrupted workbook on disk!
clonedWb.Save(@"C:\scratch\output2.xlsx", Aspose.Cells.SaveFormat.Auto);
I used .NET 5 for this reproduction but we’ve seen the issue on .NET Framework 4.8 as well. I did some testing with older versions of Aspose, and it seems like versions 20.12.0 and earlier are not affected by this bug.
Only some of our workbooks trigger this bug; I have not been able to identify a pattern.
Thank you in advance, and just let me know if you need any additional information!
Legal Stuff
Canalyst considers the Excel file attached hereto, including the information, data and content contained therein (the “Model”), to be Confidential Information as defined within the Aspose Pty Ltd’s End User License Agreement last revised January 19, 2021. By accessing the Model, Aspose Pty Ltd. acknowledges and agrees that the Model has been provided to it solely for the purposes of resolving the technical issues related thereto and shall not be used by it, its employees, contractors or agents for any other purpose than as stated herein.