Free Support Forum - aspose.com

Aspose.Cells Exceptions

Hello,

I am now using Aspose.Cells Workbook.Open Method (Stream, FileFormatType) and Workbook.Open Method (String, FileFormatType). Could you please confirm me in which case those method will return a FileFormat or UnsupportedStream exception?

When i try to simulate the FileFormat exception, through providing a .exe file or a text file renamed as a .xlsx file and calling Open(fileStream, FileFormatType.Excel2007Xlsx), i get the following exception:
Aspose.Cells.OpenXML.xc5e345d2a919c94b exception : "Cannot find central directory"

Looking forward reading you,
Regards, Renaud

Hi,

Thanks for considering Aspose.

Well you will get "Aspose.Cells.OpenXML..... exception" when you try to change any file (non native to Excel2007) format type to xlsx and open it with Aspose.Cells, But you can find "File's format type is not supported.... exception" when you do change any file (non native file related Excel 97 - 2003) format type to xls.

Thank you.

Thanks I understand. Two more things tho:

First, if such an exception is thrown and we move to another part where Aspose.Cells is temporarily no longer used, should we explicitely free the workbook that has been assigned in the first place?

Second, apart from the ExceptionType Enumeration Aspose.Cells help page is there any other document where I can find information about the different exceptions possibly returned while using Aspose.Cells?

Regards, Renaud

Hi,

First, if such an exception is thrown and we move to another part where Aspose.Cells is temporarily no longer used, should we explicitely free the workbook that has been assigned in the first place?

-----------Yes, workbook can be set to null if it will not be used

Second, apart from the ExceptionType Enumeration Aspose.Cells help page is there any other document where I can find information about the different exceptions possibly returned while using Aspose.Cells?

-----------No, ExceptionType Enumeration is the only way to different exceptions.

In the coming fix, CellException with ExceptionType.FileFormat will be thrown if the reading .xlsx file is in bad format. We will get back to you as it accomplished.

Thank you.

---------------------

Karen.huang
Developer
Aspose Nanjing Team
About Us
Contact Us

Hi,

Please try the attached version.

Regards,

---------------------

Karen.huang
Developer
Aspose Nanjing Team
About Us
Contact Us