Security

B

Brad

I have a workbook with several sheets in it. I want to set the workbook up
where you have to have a password to make changes, but anyone can open the
workbook in read only mode. I know I can set up the worksheets with a
password, but having to protect each sheet is very time consuming. Is there a
way to protect the entire workbook?
 
R

ryguy7272

Take a look at this:
http://office.microsoft.com/en-us/excel/HA101527191033.aspx

Also:
http://exceltip.com/exceltips.php?view=category&ID=20

Good info. there. Now, having dealt with this quite a bit in the part, I'd
say try to avoid it at all costs. Excel security is pretty weak; you can
prevent the casual user from pretty much anything, but you won't protect
your app. from an experienced user!! I have some code that will disable an
app. if it is removed from a network environment; I think I got the code from
Jim Thomlinson. This will add a level of security to your project, but again,
any advanced user can figure it out and disable it pretty darn quick.

One more thing, if you make sheets very hidden, users can't unhide these
from the menu option, so you definitely have some control there...of course
users can still crack any password, unhide very hidden sheets through the
VBE, access the code in the modules, and that's just the beginning.

Good luck,
Ryan---
 
J

Jacob Skaria

To protect all sheets use the below code

For intSheet = 1 to ActiveWorkbook.Sheets.Count
ActiveWorkbook.Sheets(intSheet).Protect
Next

If this post helps click Yes
 
J

john

brad,
try something like this:

Public Const passwrd As String = "mypassword123"
Sub ProtectBook()
Application.ScreenUpdating = False

With ThisWorkbook

'protect workbook
.Protect Password:=passwrd

For Each ws In .Sheets

'protect sheets
ws.Protect Password:=passwrd

Next ws

End With

Application.ScreenUpdating = True

End Sub
 

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