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

Free Support Forum - aspose.com

Workbook to html conversion generates an invalid html


I am using aspose-cells-8.0.2.jar to convert a workbook into html using the following code.
workbook.save(htmlFile.getAbsolutePath(), FileFormatType.HTML);

Converting a workbook into html generates an invalid html since tags are not being closed, attributes values are not in quotes etc…As a result I can’t apply an xsl over an invalid xml/html.

Is there a way to convert workbook into valid xhtml ?

Attached is the html output from Aspose.


Hi Jaspreet,

Thank you for contacting Aspose support.

We would request you to please give a try to the latest version of Aspose.Cells for Java 8.1.0 on your end to see how the latest build generated the HTML. Also please note that the FileFormatType has been marked obsolete so please use the SaveFormat instead.


Workbook workbook = new Workbook(myDir + “sample.xlsx”);
workbook.save(htmlFile.getAbsolutePath(), SaveFormat.HTML);

In case the problem persists, please provide us the input spreadsheet for thorough investigation.


I tried with the latest version of Aspose.Cells for Java 8.1.0 But the issue still persists. The html is not a valid xml.
Attached is the source excel document.

Thanks & Regards,

Hi Jaspreet,

Thanks for your posting and using Aspose.Cells.

You cannot save your workbook into xhtml format using Aspose.Cells. You can only save it in html only. Microsoft Excel also does not support saving workbooks into xhtml format. You can check it by opening your workbook into MS-Excel and then try saving it using Save As… menu command. Since, this feature is not supported by MS-Excel itself, therefore Aspose.Cells will also not support it.