- regular OOXML Word and PowerPoint files. CellsException with code ExceptionType.FileFormat must be thrown;
- password-protected OOXML Word and PowerPoint files if valid password is specified. As valid password was specified, and file was decrypted, then CellsException with code ExceptionType.FileFormat must be thrown.
Tested newest Aspose.Cells.dll (22.214.171.124) before including it my project and got issue.
NullReferenceException is thrown when I try to open some files:
Sample files and project attached.
Thank you for contacting Aspose support.
We have evaluated your presented scenario while using the latest version of Aspose.Cells for .NET 8.3.14, and we have noticed that Aspose.Cells for .NET API throws System.NullReferenceException while loading unsupported file formats. I agree with you that Aspose.Cells APIs should throw a proper exception, something like CellsException with code ExceptionType.FileFormat as you have suggested it. However, the Aspose.Cells APIs are incapable of decrypting presentation and document formats because this is beyond the scope of Aspose.Cells APIs. In such case where unsupported encrypted file formats are fed into an instance of Workbook, the API should throw similar exception as discussed above. Please confirm the behavior so we can log it for product team’s review.
Hi Babar Raza,
Think, that in both cases CellsException with FileFormat code should be thrown.
Thank you for the confirmation. We have logged the ticket CELLSNET-43287 in our database requesting the product team to review your requirements. Please spare us little time to properly analyze the presented scenario and it’s implementation feasibility. As soon as we receive any updates in this regard, we will post here for your kind reference.
Thanks for your using Aspose.Cells.
Please download and try the latest fix: Aspose.Cells for .NET v126.96.36.199 and let us know your feedback.
Downloaded Aspose.Cells 188.8.131.52.
NullReferenceException is no longer thrown. CellsException is thrown. This is OK.
But I have one question, why UnsupportedFeature code is used? Why not FileFormat code? For legacy files CellsException with FileFormat code is thrown. For consistency it is better to use FileFormat code for Ooxml files too.
Thank you for writing back.
It is best that the product team addresses your concerns, therefore we have logged your comments to the ticket associated with this thread. Please allow us little time to discuss this matter internally and get back to you with updates in this regard.