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

Free Support Forum - aspose.com

Save to HTML Individual Sheet

I am working with the ability to save a workbook as HTML and was wondering if there is a way to only save specific worksheets instead of the entire workbook?


Please check the article, although the article is regarding render PDF file(s) per sheet, but you try to use the similar approach for your needs:

See a sample code below:

Sample code:

//Get the Excel file path
string filePath = @"e:\test\Book1.xls";
//Instantiage a new workbook and open the Excel
//File from its location
Workbook workbook = new Workbook(filePath);

//Get the count of the worksheets in the workbook
int sheetCount = workbook.Worksheets.Count;

//Make all sheets invisible except first worksheet
for (int i = 1; i < workbook.Worksheets.Count; i++)
workbook.Worksheets[i].IsVisible = false;

workbook.Save("e:\\test2\\worksheet-tohtml.html", SaveFormat.Html);

Thank you.