views:

36

answers:

2

I found a way to hide Excel sheets which is as follows: set the visibility of the sheet to VeryHidden in the VBAProject properties and then password protect VBAProject properties.

This is great, but in Excel 2007, if you save it as XLSX, the VBAProject password protection is stripped and you can view the VBA code. Is there any way to prevent this?

OR, is there any other way to hide an Excel 2007 sheet?

+3  A: 

Here is what you do in Excel 2003:

  1. In your sheet of interest, go to Format->Sheet->Hide and hide your sheet.
  2. Go to Tools->Protection->Protect Workbook, make sure Structure is selected, and enter your password of choice.

Once this is done, the sheet is hidden and cannot be unhidden without the password. Make sense?

(Given Excel's backward compatibility, I'm sure you can do this in 2007)

Edit

If you really need to keep some calculations secret, try this: use Access (or another Excel workbook or some other DB of your choice) to calculate what you need calculated, and export only the "unclassified" results to your Excel workbook.

PowerUser
@PowerUser: This looks really good!
Jacob
A: 

No.

If the user is sophisticated or determined enough to:

  1. Open the Excel VBA editor
  2. Use the object browser to see the list of all sheets, including VERYHIDDEN ones
  3. Change the property of the sheet to VISIBLE or just HIDDEN

then they are probably sophisticated or determined enough to:

  1. Search the internet for "remove Excel 2007 project password"
  2. Apply the instructions they find.

So what's on this hidden sheet? Proprietary information like price formulas, or client names, or employee salaries? Putting that info in even an hidden tab probably isn't the greatest idea to begin with.

BradC
@BradC: So what's the normal practice to hide proprietary data on Excel?
Jacob
@Jacob: Excel certainly provides you with mechanisms to hide data (including @PowerUser's excellent answer), but my point is that you can't rely on that protection to be bulletproof, due to the existence of utilities than can crack them. So for me, it depends on *what* data I am trying to protect. Customer data or trade secrets (even hidden) have no business in a workbook that is distributed outside the company, due to liability reasons. Mostly I use these features simply to keep users from messing up the "working parts" of a complicated workbook.
BradC
@BradC: OK, so your position is, don't put trade secrets in a workbook.
Jacob
I have to agree with BradC also. Try googling "excel password recovery" and you'll find small programs that can use brute force to crack the Excel file. I guess it depends on how "secret" you want this data to be.
PowerUser