• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Very Hidden Protection didn't work for me

fred

Member
I was reading and learning to use the technique from http://chandoo.org/wp/2009/01/22/hide-excel-worksheet-tab/


I followed all the steps including "lock project for viewing" and assigned a password to Sheet2 (assigned as xlsheetVeryHidden), click ok and left Visual Basic screen.


But when I reopen visual basic, hi-light sheet2 under "MS Excel Object". I was able to change from xlSheetVeryHidden to xlsheetVisible and the protection did not kick in asking me for a password. What did I do wrong?
 
You need to close the XL workbook, and then try and go back in. As long as the workbook is open, the VBE is keeping track of "fred has proven that he has access to this code, so he can change whatever he wants". Once you leave and try to get back in, the VB will prompt you for password "Are you fred? Only Fred can see this!"


Which, is kind of convenient when you're working on some protected code for awhile. You only have to give the password once.
 
I tried but it didn't work.


I save the file twice once using .xlsx and the other in .xlsm. In both cases, the password setting disappeared after leaving Excel and returning to Excel. I didn't just close the file but I also exit the Excel application entirely.


I also tried hiding the worksheet as blank or with random text and numbers. Same thing, password disappear when I log back into Excel and open the file in Visual Basic.
 
Strange...

I've tried going through Chandoo's instructions and it works on my machine (granted, using 2003).


Silly questions (but just maybe??):

1. Is there something actually in the workbook?

2. Did you re-save after applying the password?

3. Is it opposite day where you're at and thus protection is actually meaning allow??


Sorry for silliness of #3, but I really have not other ideas. =(
 
I'm using Excel 2007 and I save everything before leaving Excel application. I also try to save the veryhidden sheet in 2 cases: blank sheet and, sheet with text and numbers. Same thing, password is gone after I tried returning to Excel.


May be it has to do with the set up of Excel.
 
Fred

This only works when saving the file as an .XLSM in 2007/10.

The whole idea is that you will have an UnHide subroutine to make the very hidden sheets visible and so locking the VB Editor makes it secure

If you don't want to include an UnHide routine just include a simple dummy routine into any Worksheet or Workbook Object

[pre]
Code:
Sub Dummy()
End Sub
[/pre]
 
Back
Top