Protecting Sheets

T

Terry Holland

Im trying to find a way to protect some data in some spreadsheets that we
have in our company. I know you can password protect the sheet/book, but I
also know that there is a crack for these passwords on the net. Also, waht
we are concerned about is staff leaving & taking the data with them. While
they are at the company they will need access to password so I need to come
up with another way of hiding the data.

What I've been looking into is some code that runs when the book is opened
that uh-hides sheets with data on that are hidden by default. What I do is
check the system of the pc to look for a hidden directory structure on all
machines in the company. If the directory exists, it is assumed that the
book is being opened on a company pc and the hidden sheets are made visible.
If it doesn't, or the Disable Macros option is selected when book opens,
then the sheets remain hidden. This works ok except for the fact the user
can go to the Format | Sheet menu item and Un-Hide any hidden sheets.

Could someone suggest any ways around this, or any other ways of achieving
the desired results.

tia

Terry

Holland
 
H

Harald Staff

Hi Terry

If you protect the workbook (Tools > protection > protect workbook) then
users can't unhide sheets. Assuming also that the VB project is password
protected, so users can't do the thing there or read the password from the
code. Consider also using
Sheets(2).Visible = xlVeryHidden
which keeps sheets away from the Unhide menu. But DO protect the workbook
anyway.

Nothing in a computer is really safe, and less safe in Excel than in many
other applications. But you are close to As good as it gets.

HTH. Best wishes Harald
 
T

Terry Holland

In Access I can compile my mdb into an mde and therefore effectively hide
the code. Is this possible in Excel? As i mentioned earlier, there is a
utility on web for around $35 that will reveal excel passwords - which will
enable users to unhide & view code
 
H

Harald Staff

No. Excel protection is for preventing the average user from destroying
functionality by accident or stupidity. You could compile your code into a
com addin, that would be the safest way to protect Excel code. Or you could
remote control Excel from a compiled exe file. Your workbook content is
still unsafe though.

HTH. Best wishes Harald
 
H

Harald Staff

VBA does it pretty simple in Windows NT/2k/XP

Sub test()
MsgBox Environ("computername")
End Sub

For win9x you need some API programming, but it's also pretty
straightforward.

HTH. Best wishes Harald
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top