Can open documents in Excel but Aspose.Cells has issues

Hi Aspose team,



when I try to process some documents I am getting error: “This file’s format is not supported or you don’t specify a correct format.” but when I try to open document(s) in Excel I am not getting any error.



Sample project and affected documents (1.xls and 2.xls in debug folder) are attached.



Can you please check and let me know why documents cannot be open?



Thanks for help,

Oliver

Hi,

Thanks for the template files and sample project.

I have checked your both template Excel files, these are of type "Microsoft Excel 5.0/95 Workbook". This is an older Excel file format which is not supported, so, you are getting the exception for the file(s) e.g "...This file's format is not supported....". For your information, Aspose.Cells supports BIFF8 or greater formats (Excel 97 - Excel 2010/2013). To confirm these are "Microsoft Excel 5.0/95 Workbook", you may try to open any file into MS Excel 2003/2007 and try Save it As, now you can see the save as type i.e. "Microsoft Excel 5.0/95 Workbook" in the Save As dialog box.

As a workaround, you may try the following steps to work with the files for Aspose.Cells product, so that Aspose.Cells could open/process the files fine.
e.g
Open your template file(s) into MS Excel (e.g..,Ms Excel 2003 or 2007).
Save the file As "Microsoft Office Excel Workbook".
Now you can use Aspose.Cells to open/manipulate or render the files for your requirements.

Note: I am afraid, there is no other alternative as above because Aspose.Cells does not support BIFF7 or earlier MS Excel formats.

Thank you.

Hi Amjad,

thanks for quick check.

Is there any way that instead of generic message “This file’s format is not supported” we get info that file format is Excel 5.0/95?

Thanks,
Oliver

Hi,


Yes, sure, see the following sample code for your reference:
e.g
Sample code:

[C#]
FileFormatInfo finfo = FileFormatUtil.DetectFileFormat(@“E:\test2\ExcelErrors\FormsThreadVB\bin\Debug\1.xls”);
Console.WriteLine(finfo.FileFormatType);

[VB]
Dim finfo As FileFormatInfo = FileFormatUtil.DetectFileFormat(“E:\test2\ExcelErrors\FormsThreadVB\bin\Debug\1.xls”)
Console.WriteLine(finfo.FileFormatType)

Hope, this helps a bit.

Thank you.

Forgot to say - thanks :slight_smile:

Hi Oliver,

Thanks for your kindness. We appreciate it and thank you for using our Aspose APIs. Have a nice day and cheers. :slight_smile:

@dr.doc,

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: