Error with Biff8 xls

Hi,


I have a xls worksheet which fails to open in aspose.cells,
When I try to load it with: LoadFormat.AUTO
I get the following exception:
This file’s format is not supported or you don’t specify a correct format.

When I try to pen the file with: LoadFormat.EXCEL_97_TO_2003
I get the following exception:
This Excel files contains BIFF7(Excel95 or earlier file format) records.

I tried to check the Biff version and it says Biff8 in the CompObject stream as the attached screenshot shows.

The xls file is valid and opens fine an any office.

This issue is present in aspose.cells 8.5.0 but also present in your latest versions, I tested.

Hi,


Thanks for providing us screenshot and details.

Could you provide your template XLS file, we will check it soon.

Thank you.

Hello,


I figured out why the the attempt to load the file fails.
It contains a steam named “Book” which related to Biff5 - office 95 format.
While a Biff8 (office 97-2003) related stream for a workbook is called Workbook.

This is very hard to diagnose, is it possible to make the “This file’s format is not supported or you don’t specify a correct format.” message more verbose?
Like “Encountered unsupported stream \Book.” or something like that?

Hi,


Good to know that you have sorted out your issue now.
Well, you may detect file format type prior loading via Workbook object to handle it accordingly (so, Aspose.Cells should not open the file). See the following sample code for your reference
e.g
Sample code:

string filePath = “___________”;
FileFormatInfo fileInfo = FileFormatUtil.DetectFileFormat(filePath);
if(fileInfo.FileFormatType == FileFormatType.Excel95)
{
Console.WriteLine(“File is saved as Excel 95 file format or it contains records for Excel 95 which is not supported by Aspose.Cells APIs”);
//Your code goes here.
//…
}

Hope, this helps a bit.

Thank you.

@arik-1,

We recommend you to kindly try upgrading to and use latest version of the product which includes support for older BIFF7 (Excel 95/5.0 - 2003 Workbook) formats with enhancements now:

Also, see the document for supported input and output file formats by Aspose.Cells: