Write HTML contains to EXCEL file using ASPOSE.cells

Hi,
As we know that we can open html files in excel, so can you guys please tell me that how can I write html contains to a workbook object so that i can save it as .xlsx file?

Thanks & Regards,
KapilJ

Hi,


I am afraid, this feature [reading HTML file with Aspose.Cells] is not supported yet. Right now, with this API you can read/write any Excel related files [XLS, XLSX, ODS…] Moreover, you can also export the workbook/worksheets to images, PDF and HTML.

Is there possibility that this feature will be supported by you?
I went through your old mails of some time 2009 the same problem is there also.

Thanks & Regards,
KapilJ

Hi,

If you are using a Java version, I think reading html files is supported. But the html file should be saved by ms excel or with the same format. For a common web html file, I am afraid we do not support to read it.

Will you please tell me how can I achieve this? Is anything special needs to be declared in HTML file to know it should work with excel?

Thanks & Regards,
KapilJ

Hi KapilJ,


You can try this method [as shared by my colleague] by saving any XLS spreadsheet to HTM format using MS Office Excel [I tried with Excel 2010]. You can read this HTM file with below code and can manipulate it before saving it to XLS format.

JAVA
Workbook wb = new Workbook();
wb.open(“C:\temp\book2.htm”);
wb.getWorksheets().getSheet(0).getCells().getCell(“A1”).setValue(“this is another test”);
//If you do not use the second parameter in below save method then the generated file will have HTM extension.
wb.save(“c:\temp\out_test2.xls”, FileFormatType.EXCEL97TO2003);

Attached are the sample input and output files.