Solved

Excel: Don't allow user to unhide sheets

Posted on 2010-11-07
5
467 Views
Last Modified: 2012-05-10
I would like to make some hidden worksheets in an Excel file. How do i make it so that a user can't unhide my hidden worksheets?
0
Comment
Question by:ouestque
  • 3
5 Comments
 
LVL 7

Expert Comment

by:John15-16
ID: 34081249
I have used the xlSheetVeryHidden property in VBA before and that worked for me.  Do you know how to accomplish this or would you like me to post a sample?
0
 
LVL 7

Accepted Solution

by:
John15-16 earned 167 total points
ID: 34081271
Just change the sheet name below in quotes.

Sub Test()
Worksheets("Sheet1").Visible = xlVeryHidden

End Sub
0
 
LVL 50

Assisted Solution

by:Dave Brett
Dave Brett earned 167 total points
ID: 34081272
In short there is no foolproof method to enforce the protection.

You have two options
- VeryHidden (as per comment above)
- Protecting the workbook structure

Both are easily defeated, the first with basic VBA knowledge, the second by trivial code that cracks the password. The sructure protection being a little harder to crak in my view

That said you should use both together.

Cheers

Dave
0
 
LVL 7

Expert Comment

by:John15-16
ID: 34081313
Dave is correct.  I should have prefaced my first statement by saying the solution worked for me because my users have no VBA knowledge (other than recording macros).  
0
 
LVL 23

Assisted Solution

by:Michael74
Michael74 earned 166 total points
ID: 34081421
ouestque

1. In the workbook select ALT+F11 to open visual basic editor
2. On the left select the worksheet to be hidden
3. If the properties window is not visible select "View/Properties Window"
4. In the Visible field of the properties window change the value to "2 - xlSheetVeryHidden"
5. Select Tools/VBAProject Properties
6. On the Protection tab sellect "Lock project for viewing" and enter a password

While this is not perfect it will stop the casual user
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Sparklines have been introduced with Excel 2010 and are a useful tool for creating small in-cell charts, used for example in dashboards. Excel 2010 offers three different types of Sparklines: Line, Column and Win/Loss. What it does not offer is a…
Workbook link problems after copying tabs to a new workbook? David Miller (dlmille) Intro Have you either copied sheets to a new workbook, and after having saved and opened that workbook, you find that there are links back to the original sou…
The viewer will learn how to simulate a series of coin tosses with the rand() function and learn how to make these “tosses” depend on a predetermined probability. Flipping Coins in Excel: Enter =RAND() into cell A2: Recalculate the random variable…
The view will learn how to download and install SIMTOOLS and FORMLIST into Excel, how to use SIMTOOLS to generate a Monte Carlo simulation of 30 sales calls, and how to calculate the conditional probability based on the results of the Monte Carlo …

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now