We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Landray RDM 112148 Convert Effect

cells source code:
src.zip (1.6 KB)

origin excel:
线路交易营收汇总表(2020.7.7).xls.zip (81.3 KB)

converted error:

Caused by:com.aspose.cells.CellsException: This file’s format is not supported or you don’t specify a correct format. com.aspose.cells.zjp.a(Unknown Source) com.aspose.cells.Workbook.a(Unknown Source) com.aspose.cells.Workbook.(Unknown Source) com.landray.converter.executor.aspose.AsposeExcelConverter.doConvert(AsposeExcelConverter.java:57) com.landray.converter.executor.aspose.AsposeToHTMLConverter.doExcelConvert(AsposeToHTMLConverter.java:90) com.landray.converter.executor.aspose.AsposeToHTMLConverter.convert(AsposeToHTMLConverter.java:39) com.landray.converter.executor.AsposeExecutorMain.main(AsposeExecutorMain.java:35) sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) java.lang.reflect.Method.invoke(Method.java:606) org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader.main(JarRsrcLoader.java:58)

Please have a check.


Thanks for the template file, sample code and stack trace.

I checked your template file and found your so called XLS file is not an Excel file but an HTML (Web page), so you need to change the line of code in your code segment:
LoadOptions loadOptions = new LoadOptions();
LoadOptions loadOptions = new LoadOptions(LoadFormat.HTML);

I have tested using the changed line of code and it works fine.

Let us know if you still find any issue.

If I change the code to LoadFormat.HTML,could it also convert the real XLS file?


Please note, the above line will load the file as HTML into Aspose.Cells object model which is compulsory for loading your so called (XLS file which is actually an HTML) file. For loading a real Excel file, you will use only the following line:
LoadOptions loadOptions = new LoadOptions();