Corrupt XLSX causes load to hang

The attached XLSX file is corrupt. But when an attempt to load it with
string excelFile = @“c:\temp\2.xlsx”;
try
{
Aspose.Cells.Workbook wb = new Aspose.Cells.Workbook(excelFile);
}
catch(Exception ex)
{
Console.WriteLine(ex.Message);
}
the program hangs. It would be nice if it threw an exception.
Thank you,
Jeff
Aspose_CorruptXLSXFile.zip (10.0 KB)

@JeffBallance,
I have tried to open this file in Excel 365 but got the exception as stated by you. Regarding the exception, it depends upon the nature of issue in the source file. Sometimes it may put the API into some infinite loop causing it to be hanged for long time. API may not decide itself about the validation of such loop as sometimes real large data is there in files. This is just one scenario which I shared here. Therefore it is not always possible to throw exception. You may please use programming language features which interrupt the program after specified intervals as per your need. It will help you to control the program if it is taking long time to execute.

Thank you for the reply. I can add the timeout code, but I would have thought that the Aspose library would have looked at the file signature to determine if it was a valid candidate file.
Jeff B.

@JeffBallance,
Aspose.Cells mimics the behaviour of Excel and has tuned its algorithms such that it almost behaves like Excel. However, as Microsoft has not published their proprietary algorithms so it is not always possible to achieve the exact performance. However we are logging this requirement to “raise an exception instead of hanging the program” into our database for an investigation and fix if possible. Once, we will have some news for you, we will update you in this topic.

This issue has been logged as

CELLSNET-46954 – Raise Exception similar to Excel instead of hanging program

@JeffBallance,

This is to inform you that we have fixed your issue (logged earlier as “CELLSNET-46954”) now. We have fixed the issue of hanging and an exception will be thrown in the next fix. We will soon provide you the fixed version after performing QA and incorporating other enhancements and fixes.

@JeffBallance,

Please try our latest version/fix: Aspose.Cells for .NET v19.9.4:

Aspose.Cells19.9.4 For .Net2_AuthenticodeSigned.Zip (4.9 MB)
Aspose.Cells19.9.4 For .Net4.0.Zip (5.0 MB)

Your issue should be fixed in it.

Thank you very much. This works just great! I appreciate your following up and providing the latest internal build.
Jeff

@JeffBallance,
You are welcome and good to know that your issue is sorted out by the shared version. Feel free to contact us at any time if you need further help or have some other issue or queries, we will be happy to assist you soon.

The issues you have found earlier (filed as CELLSNET-46954) have been fixed in Aspose.Cells for .NET v19.10. This message was posted using Bugs notification tool by Amjad_Sahi