HTML

Converting Excel Workbook to HTML

The Aspose.Cells API provides support for exporting spreadsheets to HTML and format. For this purpose, Aspose.Cells uses the HtmlSaveOptions class to provide the flexibility to control several aspects of the output HTML.

The code example below shows how to save a workbook as an HTML file using C#:

// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-.NET
//Load your source workbook
Workbook workbook = new Workbook("Book1.xlsx");
//save file to html format
workbook.Save("out.html");

Converting Excel Workbook to MHTML Files

MHTML combines normal HTML with external resources (that is, content that is usually linked in, like images, animations, audio, and so on) into one file. They are used for emails with the .mht file extension.Aspose.Cells supports reading and writing MHTML files.

The code example below shows how to save a workbook as an MHTML file using C#:

// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-.NET
//Load your source workbook
Workbook workbook = new Workbook("Book1.xlsx");
//save file to mhtml format
workbook.Save("out.mht");

Advance topics