Can someone explain why the code below does not actually hide the worksheet?
workbook.Worksheet("Saber Tooth Audit Legend").Hide();
workbook.Worksheet("Saber Tooth Audit Legend").Visibility = XLWorksheetVisibility.Hidden;
workbook.SaveAs(destination);
Does Hide not actually Hide? When I open the Excel file it's worse than not hidden the focus is set to that tab in particular. What the heck is going on?
Also when I Unhide a worksheet it does not Unhide().
Is it my code?
Comments: Any update on this? I'm having the same issue. Not sure if this is the problem or not, but the value of the ClosedXML constants don't match the associated constants in Excel: ClosedXML XLWorksheetVisibility.Visible = 0 XLWorksheetVisibility.Hidden = 1 XLWorksheetVisibility.VeryHidden = 2 Excel xlSheetVisible = -1 xlSheetHidden = 0 xlSheetVeryHidden = 2
workbook.Worksheet("Saber Tooth Audit Legend").Hide();
workbook.Worksheet("Saber Tooth Audit Legend").Visibility = XLWorksheetVisibility.Hidden;
workbook.SaveAs(destination);
Does Hide not actually Hide? When I open the Excel file it's worse than not hidden the focus is set to that tab in particular. What the heck is going on?
Also when I Unhide a worksheet it does not Unhide().
Is it my code?
Comments: Any update on this? I'm having the same issue. Not sure if this is the problem or not, but the value of the ClosedXML constants don't match the associated constants in Excel: ClosedXML XLWorksheetVisibility.Visible = 0 XLWorksheetVisibility.Hidden = 1 XLWorksheetVisibility.VeryHidden = 2 Excel xlSheetVisible = -1 xlSheetHidden = 0 xlSheetVeryHidden = 2