Export print area range to HTML

Possible Usage Scenarios

This is a common scenario where we need to export only the print area, i.e., a selected range of cells, instead of the entire sheet to HTML. This feature is already available for PDF rendering; however, you can now perform this task for HTML as well. First, set the print area in the page‑setup object of the worksheet. Later, use the HtmlSaveOptions.ExportPrintAreaOnly flag to export only the selected range.

Sample Code

Following sample code loads a workbook and then exports the print area to HTML. Sample file for testing this feature can be downloaded from the following link:

sampleInlineCharts.xlsx