Aspose cells for java cant read some xls files


aspose cells for java cant read the following xls file (9.2 KB)

I included the code and the exception
other xls and xlsx files work as expected


Workbook workbook = null;
try {
workbook = new Workbook(filename);
} catch (Exception e) {
throw new CantReadFileException("error reading workbook " + e);

com.aspose.cells.CellsException: This file’s format is not supported or you don’t specify a correct format.
at com.aspose.cells.Workbook.a(Unknown Source)
at com.aspose.cells.Workbook.(Unknown Source)
at aspose.MainApplication.main(



Thanks for the template file and sample code segment.

I checked your template XLS file which is an older format (“Microsoft Excel 5.0/95 Workbook”). The previous versions (before v19.1) do not support older file formats but latest version (i.e., Aspose.Cells for Java 19.1.x) does support Excel 5.0/95 XLS file format. Please try our latest version/fix: Aspose.Cells for Java v19.1.1 (attached)

It works fine with your attached file.

Let us know your feedback. (6.5 MB)


thanks for the response , the original xls file worked fine in 19.1,
however I have another xls file,“newbad” that doesnt work even in 19.6 .
when converting it from xls to xlsm the xlsm gets created with gibrish inside. (14.9 KB)



Thanks for providing template file.

Good to know that your previous issue was fixed. Regarding your newer issue, I have checked your so called .xls file and found it is actually an HTML (“Web page”) file. Since it is not a native MS Excel file (XLS, XLSX), so Aspose.Cells thinks it is a txt file. The output file will have the exact source tags and data in it. Also, when you open the file into MS Excel, it prompts an error.

Please try the following sample code to convert your file to XLSM file format for your needs, I have tested using latest version and it works fine:
Sample code:

HTMLLoadOptions opts = new HTMLLoadOptions(LoadFormat.HTML);
        Workbook workbook = new Workbook("f:\\files\\newbad.xls", opts);"f:\\files\\out1.xlsm", SaveFormat.XLSM);

Hope, this helps a bit.


thanks, this helped



Good to know that your issue is sorted out by the suggested sample code. Feel free to contact us any time if you need further help or have some other issue or queries, we will be happy to assist you soon.