Hide Sheet using Workbook Open Event

  • Thread starter Thread starter johnhildreth
  • Start date Start date
J

johnhildreth

I know this is simple, but I can't seem to get it to work. I want to
hide (make not visible) the HelpSheet worksheet. I was going to use
the WorkbookOpen event to make sure it is not visible each time the
workbook is opened.

Private Sub XL_WorkbookOpen(ByVal Wb As Workbook)
Worksheets("HelpSheet").Visible = xlSheetVeryHidden
End Sub

I have the above code in a class module. But the sheet is still
visible. Where did I go wrong?

Thanks,
John
 
Hi John,

Try:

Private Sub Workbook_Open()
Worksheets("HelpSheet").Visible = xlSheetVeryHidden
End Sub
 
Put your code in:

Private Sub Workbook_Open()

End Sub

which is in ThisWorkbook under the folder "Microsoft Excel Objects"
 
Used your code...thank you very much....but the worksheet is still
visible. What is the deal?

Thanks again,
John
 
Got it. Your code is correct....but you knew that. It needed to be in
the ThisWorkbook module. Not in a class module.

John
 
Back
Top