// Create a zip file stream FileStream outputStream = new FileStream("SaveWorksheetToHtmlWithInlineCss.zip", FileMode.Create); //create a new workbook var workbook = new GrapeCity.Documents.Excel.Workbook(); Stream fileStream = this.GetResourceStream("xlsx\\BreakEven.xlsx"); workbook.Open(fileStream); HtmlSaveOptions options = new HtmlSaveOptions(); // Set the css export type to inline css. options.CssExportType = CssExportType.Inline; workbook.Save(outputStream, options); // Close the zip stream outputStream.Close();
' Create a zip file stream Dim outputStream = File.Create("SaveWorksheetToHtmlWithInlineCss.zip") ' Create a new Workbook Dim workbook As New Workbook Dim fileStream As Stream = GetResourceStream("xlsx\BreakEven.xlsx") workbook.Open(fileStream) ' Set the css export type to inline css. Dim options As New HtmlSaveOptions With { .CssExportType = CssExportType.Inline } workbook.Save(outputStream, options) ' close the zip stream outputStream.Close()