PDA

View Full Version : Solved: Worksheets are Not Remaiming xlVeryHidden



coliervile
03-07-2008, 10:22 AM
Good day to everyone. When I open my workbook and depending if the macros are enabled or disabled certain worksheets are suppose to be visible and/or very hidden (xlVeryHidden). The worksheets don't display when the workbook is opened, but the worksheets are accessible through the toolbar Format- Sheet- Unhide. I thought that when worksheets were "xlVeryHidden" they weren't accessible though the toolbar Format- Sheet- Unhide.

Is there something that I'm missing in my coding or am I incorrect about the accessibilty through the toolbar Format- Sheet- Unhide when worksheets are "xlVeryHidden"???


Private Sub Workbook_BeforeClose(Cancel As Boolean)

Sheets("Warning").Visible = True

Sheets("Printout").Visible = True
Sheets("Printout").Select
Range("A2:E65399").Select
Selection.ClearContents
Range("A2").Select
Sheets("Printout").Visible = False

Sheets("Printout").Visible = x1VeryHidden
Sheets("Dashboard").Visible = x1VeryHidden

Sheets("Leave Request").Visible = x1VeryHidden
ActiveWorkbook.Save
End Sub
Private Sub Workbook_Open()

Sheets("Dashboard").Visible = True

Sheets("Warning").Visible = x1VeryHidden

Sheets("Printout").Visible = x1VeryHidden
Sheets("Leave Request").Visible = x1VeryHidden

End Sub

coliervile
03-07-2008, 10:40 AM
I found my error I accidentally typed a one (1) in stead of the letter "l" and I copied it this way....Dumb Move.

A second question- even when the macros are disable and the worksheet "Warning" is displayed the user has access to view the coding through View Code on the worksheet tab. Other than using a password is there a way to prevent the user from accessing the code/s???

Bob Phillips
03-07-2008, 11:39 AM
No, it is part of the project, so a project password is the only way (other than use a DLL and call out to that, but you don't want to go there).

coliervile
03-07-2008, 11:53 AM
Good day to you "XLD". I'll be starting a seperate thread on the usage of passwords and/or protection of a workbook, worksheet, and VBA to get some answers on that topic too. I'm sure this is a popular subject a matter that all of us can benefit from and I would be interested in your insight as well.