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

Free Support Forum - aspose.com

Save a worksheet As a Html

How can I save a worksheet as a html page. Better yet. is it possible to expert a workseet into a string (c#) in html format?

Currently Aspose.Excel doesn’t support to export file as html format. We will implement this feature but it will take about several months.

So, there is no way to display the Aspose.Excel object in any other way but useing the MS Excel, which is what I tried to avoid in the first place.

Yes. Aspose.Excel is a spreadsheet creation engine to generate file with native excel format. So you have to use MS Excel or ExcelViewer to display the result file. But please keep an eye on our product. We are working on html issue and display control.

I will certainly use them as they become available. The problem is they are months away. What ExcelViewer are you referring to?

When do you excpect the html and the display functionality to be available? The ExcelViewer is not very usefull form my purpose.

Hi Roman,

If you want to display the content of an Excel file, you can also try a workaround. You can make the UI by yourself and bind the data in Excel object. Aspose.Excel supplies several ways to export data in the file. Please refer to Cells.ExportDataTable,Cells.ExportDatable and cell properties.

I’m guessing the ExportDatable will produce an “N x N” table of data. This falls short of what I need.

I need all the cell-merging, bolding, and cell-colors of my Excel file preserved into a fancy HTML table. My clients won’t necessarily have Excel, so I need to dump a file on the screen as HTML (formatting and all).

Is there any option that will be available in the next 30 days that will do this?

Thanks for any help you can give me :slight_smile:


Hi Sam,

We are working on a new Excel Web Control to display contents of Excel file with all styles and format. But it’s complex and the planned release date will be someday in September.

Sam, did you come up with a solution? Any ideas? I am in the same situation as you are. My clients migh not have an Excel installation.


Do you have any code examples for the Cells.ExportDataTable,Cells.ExportDatable and cell properties.?


No, but I did find a simple algorithm searching google that would create an HTML with horizontal cell merging, border, and background color. It was in C# (+?) But I can’t find it again. :frowning:
It was far from perfect, but honestly, if you add vertical cell merging & row/col widths, its all I need.

Actually, I may have it in source safe… I’ll see if I can find it.

Any help (from anyone) is much appreciated!


We are working on a new web control to display contents of Excel file. It will be available at the start of September. Now thanks for your patience.

Now you can try the following workaround :
1. You can put a Datagrid in your web page
2. Bind data with DataTable exported with ExportDataTable method
3. Set the style in the Datagrid

Sample code about ExportDataTable can be found at http://www.aspose.com/Products/Aspose.Excel/Guide/ImportExport.html.

Aspose.Cells has replaced Aspose.Excel which is no more available now. This new product is far better in terms of performance and number of features which are supported for latest versions of MS Excel. Aspose.Cells has provided conversion of Excel file to HTML by configuring a number of properties and settings. Here is an example of converting Excel file to HTML.

// Load the Excel file.
Workbook wb = new Workbook(sourceDir + "sampleInlineCharts.xlsx");

// Access the sheet
Worksheet ws = wb.Worksheets[0];

// Set the print area.
ws.PageSetup.PrintArea = "D2:M20";

// Initialize HtmlSaveOptions
HtmlSaveOptions options = new HtmlSaveOptions();

// Set flag to export print area only
options.ExportPrintAreaOnly = true;

//Save to HTML format
wb.Save(outputDir + "outputInlineCharts.html", options);

You may review the following section of document to get detailed information about the features for converting Excel file to HTML and vice versa:

Here is the link to download the latest version of the product:
Aspose.Cells for .NET (Latest Version)

A ready to run solution is available here to test the features of this product without writing any code.