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;
                    break;
                case ".xls":
                    loadFormat = LoadFormat.Excel97To2003;
                    break;
                default:
                    loadFormat = LoadFormat.CSV;
                    break;
            }
            htmlOptions = new HtmlLoadOptions(loadFormat);
            htmlOptions.ConvertNumericData = false;
            
            if (stream == null)
            {
                workbook = new Workbook(); // Only needed to avoid null checks later
            }
            else
            {
                workbook = new Workbook(stream, htmlOptions);
            }
        }

@cat062081,

Excluding hidden worksheets is possible if you are exporting to HTML file format, see the sample code for your reference:
e.g
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);