I was wondering if there is an easy way to lock out users from accessing tabs. I found code that prevents the user from right-clicking the active tab and choosing "Unhide"... (see below)
Code:
[Indent]Application.CommandBars("Worksheet Menu Bar").Controls("F&ormat").Controls("S&heet").Controls("&Unhide...").Enabled = False[/Indent]
But of course it interfere's with VBA opening and closing hidden forms. So I've had to add True/False code to every Procedure that opens a form.... well somehow/someway, sometimes... things screw up and then I have issues opening and closing forms. It's almost like Excel is too slow and or skips code. I don't get it. Is there another way of doing this?
Also as far as Protecting pages. I have most of my datasheets protected so users can't affect them, only VBA can thru forms. I use this code:
Code:
[Indent]Dim AdminPass As String[/Indent]
[Indent]AdminPass = Sheets("Office Form").Range("U2").Value[/Indent]
[Indent]ThisWorkbook.Sheets("Office View").Unprotect Password:=AdminPass[/Indent]
Then of course, protect it again once the code has processed. Is there a better way of doing it, or is this it?