Get issue of Aspose.Cells when read excel 2007 file

We are using Aspose.Cells 4.3.0.2, when read a .XLSX file then get the error below.

System.InvalidOperationException: This is not a structured storage file.
at Aspose.Cells.Ss.?..ctor(BinaryReader reader)
at Aspose.Cells.Ss.?.?(Stream ?)
at Aspose.Cells.Ss.?.?(String ?)
at Aspose.Cells.Workbook.Open(String fileName)


I then saved the file as .XLS and it worked fine.


How to solve this problem?

Hi,

Since you are using some older version of the product that might not support MS Excel 2007 XLSX format perfectly. So, kindly try the attached latest version/fix, it should work fine with MS Excel 2007 file formats.

If you still find the issue, kindly post your template xlsx file here, we will check your issue soon.

Thank you.

Thanks for your answer.
Error occurs at workbook.Open(

Workbook workbook= new Workbook();
Aspose.Cells.License license = new Aspose.Cells.License();
license.SetLicense(“Aspose.Cells.lic”);
workbook.Open("…");

If I download the new dll, I only need to replace the older dll with the new one, don’t need to change the code, right?

I need the dll support excel 2003 or earlier and excel 2007.

Many thanks.


Hi,

Yes, sure, you don’t need to do/change anything in your code to use the latest version that I attached in the forum post.

Thank you.

I just tried, and I don’t think I can use the latest version, as I have no license.

The subscription included in this license allows free upgrades until 25 Mar 2008, but this version of the product was released on 23 Apr 2010. Please renew the subscription or use a previous version of the product.

If I go on using the old version, add a parameter of FileFormatType can solve this issue, right?
e.g.
if filename ==
xlsx
workbook.open("…xlsx", FileFormatType.EXCEL2007);
else
workbook.open("…xls");

Hi,

Well, specifying FileFormatType parameter in Open method can solve the problem but I am not sure about your case though. Actually in older version (that you are using), we do not support to auto-detect the file format type while opening the MS Excel 2007 files. Anyways, you may do it if it works for you.

Moreover, if you still find the issue even using the latest version (you may comment the licensing code to test with it). We need your template file here to sort out your issue soon.

Thank you.