Once the spreadsheet is created, how do I append a new tab with other html markup code.
Here is what I have thus far. It creates only one tab and over wirtes it with the new html markup code. What am I do wrong?
internal static void AddHTMLToExcelFile(string HtmlData, string tabText = "", string filePath = "")
{
SpreadsheetInfo.SetLicense(SpreadsheetLicense);
ExcelFile workbook;
ExcelWorksheet worksheet;
HtmlLoadOptions htmlOptions = new HtmlLoadOptions();
MemoryStream htmlStream = new MemoryStream(htmlOptions.Encoding.GetBytes(HtmlData));
workbook = ExcelFile.Load(htmlStream, htmlOptions);
worksheet = workbook.Worksheets.Add(tabText);
int columnCount = worksheet.CalculateMaxUsedColumns();
for (int i = 0; i < columnCount; i++)
worksheet.Columns[i].AutoFit(1, worksheet.Rows[1], worksheet.Rows[worksheet.Rows.Count - 1]);
workbook.Save(filePath);
}