Hello Aspose Support,
We have an Excel 97-2003 XLS file that opens in Microsoft Excel, but Aspose.Cells for .NET cannot load it correctly.
Environment:
- Aspose.Cells for .NET: 26.7.0
- .NET: 10.0
- OS: Ubuntu
Attachment:
aspose-empty-workbook-repro-excel-openable.zip (98,1 КБ)
Expected result:
- Aspose.Cells should load the workbook data and be able to save it to PDF.
Actual result:
- Loading the file with new Workbook(path) throws Aspose.Cells.CellsException: File is corrupted.
- Loading the same file with LoadOptions.WarningCallback does not throw, but both worksheets are loaded without cell data: MaxDataRow = -1, MaxDataColumn = -1.
- Saving this workbook to PDF either creates a blank page by default or throws “There is nothing to output/print” when PdfSaveOptions.OutputBlankPageWhenNothingToPrint is set to false.
Minimal reproduction code:
using Aspose.Cells;
var filePath = args[0];
try
{
using var workbook = new Workbook(filePath);
Console.WriteLine($"Default load succeeded. Sheets: {workbook.Worksheets.Count}");
}
catch (Exception ex)
{
Console.WriteLine("Default load failed:");
Console.WriteLine(ex);
}
Observed console output:
Default load failed:
Aspose.Cells.CellsException: File is corrupted
at e.Warning(WarningInfo )
at e.e(Stream )
at e.( , Stream )
at e.( , String )
at .( , String , Boolean )
at .()
at .(String , Stream , LoadOptions )
at Aspose.Cells.Workbook.(Stream , LoadOptions , Boolean )
at Aspose.Cells.Workbook..ctor(Stream stream)
@NOborin
Hello,
Thank you for providing the sample file aspose-empty-workbook-repro-excel-openable.xls and the reproduction code snippet.
I have successfully reproduced the issue using Aspose.Cells for .NET 26.7. My investigation confirms that while the file opens correctly in Microsoft Excel, the Workbook constructor throws a CellsException stating the file is corrupted. Furthermore, when bypassing the exception via WarningCallback, the resulting object contains no cell data.
We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.
Issue ID(s): CELLSNET-60455
You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.
@NOborin
There are some invalid data in the xls file. If you save the xls file in MS Excel as xlsx, some corrupted info will be pop up.
We have fixed this issue of reading this xls file, but we are still working on removing those invalid data.
@NOborin
We are pleased to inform you that your issue (Ticket ID: “CELLSNET-60455”) has been resolved.
This fix/enhancement will be included in the upcoming release (v26.8).
The issues you have found earlier (filed as CELLSNET-60455) have been fixed in this update. This message was posted using Bugs notification tool by Agent assistant.
I confirm that the bug has been fixed in Aspose.Cells 26.8.0. Thank you, Aspose team.
@NOborin
You are very welcome! We are glad to hear that the fix is working as expected and that you can now load your XLS files correctly without encountering the empty workbook issue.
Thank you for your feedback and for confirming the resolution in the 26.8 release. Please feel free to reach out if you have any further questions or need additional assistance.