PDA

View Full Version : Permanently Hide Sheet Tabs



melsahn
05-15-2010, 10:43 AM
I have a shared workbook that I manage. Users navigate through the workbook with the links that I built. So I hide the sheet tabs so that they have to use the built navigation. But I then realized they can change the option to view sheet tabs through Tools>Options>View>Sheet Tabs. What VBA code could I put into the This Workbook
module to automatically and permanently hide the sheet tabs when the workbook is opened?

Bob Phillips
05-15-2010, 11:30 AM
Worksheets("Sheet1").Visible = xlSheetVeryHidden

melsahn
05-15-2010, 12:42 PM
But then the user wont be able to access the sheets through the navigation.




Worksheets("Sheet1").Visible = xlSheetVeryHidden

GTO
05-15-2010, 03:46 PM
...What VBA code could I put into the This Workbook
module to automatically and permanently hide the sheet tabs when the workbook is opened?

Greetings Melsahn,

I think/hope I understand what you are saying, that being that you are depending upon the sheet tabs being hidden in order to exercise some control over the user's operations in the wb.

The trouble is that if you record a macro to hide the tabs, here is what you get:

ActiveWindow.DisplayWorkbookTabs = False


So see, the .DisplayWorkbookTabs belongs to the Window object, and thus is easily 'beaten'. For instance, if with the tabs hidden, the user goes to the menubar, Window|New Window, the new window will display the tabs.

Or... Edit|Go To..., and tyoe in SHeet2!A1.

You would be better served to change tactics as Bob (xld) suggested.

Mark

p45cal
05-17-2010, 01:51 AM
It is likely that if you change the way you hide sheets, you'll have to change the way you unhide them.
Post your code?



But then the user wont be able to access the sheets through the navigation.