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

Free Support Forum - aspose.com

Export html table to Excel

how to export html table to excel?

Hi,

Well, Aspose.Cells can only convert HTML files (MS Excel oriented) which are generated with Ms-Excel or by itself. It cannot convert every HTML file to XLS/XLSX file format. Please see the sample code below.
e.g

Sample code:

string path = “Book1.htm”;

Workbook workbook = new Workbook(path);

workbook.Save(“out1.xlsx”, SaveFormat.XLSX);

Also, we provide Cell.HtmlString attribute that you may try to use to parse HTML tags/ script.

Anyways, we have already logged a ticket with an id “CELLSNET-41627” as a New Feature Request in our database for the feature (i.e…, Convert HTML table with formatting into Excel). We will look into it and implement it if possible.
Once we have any update on it, we will let you know here.

Thank you.

Hi Ibba,


Thanks for contacting support.

We have an API named Aspose.Pdf for .NET which provides the feature to create as well as manipulate existing PDF files. It offers the feature to load HTML file and save the output in PDF format or save it as MS Word file or MS Excel worksheet. So as per your requirement, you may consider loading HTML file and try saving it as XLS format. Please take a look over following code snippet.

[C#]

// load HTML file<o:p></o:p>

Document doc = new Document("c:/pdftest/samplehtml.html", new HtmlLoadOptions());

// save output as Excel worksheet

doc.Save(“c:/pdftest/samplehtml.xls”, SaveFormat.Excel);



For further details, please visit