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

Free Support Forum - aspose.com

Ignore Hidden Worksheets

Could you please tell me how to ignore hidden worksheets? Below is the code where i’m loading the workbook. Thanks!

        HtmlLoadOptions htmlOptions;

        if (inputFileFormatId == SharedConstants.FileFormat.Excel)
            LoadFormat loadFormat;
            switch (extension.ToLower())
                case ".xlsx":
                    loadFormat = LoadFormat.Xlsx;
                case ".xls":
                    loadFormat = LoadFormat.Excel97To2003;
                    loadFormat = LoadFormat.CSV;
            htmlOptions = new HtmlLoadOptions(loadFormat);
            htmlOptions.ConvertNumericData = false;
            if (stream == null)
                workbook = new Workbook(); // Only needed to avoid null checks later
                workbook = new Workbook(stream, htmlOptions);


Excluding hidden worksheets is possible if you are exporting to HTML file format, see the sample code for your reference:
Sample code:

var options = new HtmlSaveOptions
ExportImagesAsBase64 = true,
ExportSingleTab = true,
ExportHiddenWorksheet = false,
ExportGridLines = true,
HiddenRowDisplayType = HtmlHiddenRowDisplayType.Remove,
HiddenColDisplayType = HtmlHiddenColDisplayType.Remove

        using (var wb = new Workbook("e:\\test2\\MyFile.xlsx"))
            wb.Save("e:\\test2\\out1.html", options);