ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Security (https://www.excelbanter.com/excel-programming/425722-security.html)

Brad

Security
 
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?

ryguy7272

Security
 
Take a look at this:
http://office.microsoft.com/en-us/ex...527191033.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---

--
RyGuy


"Brad" wrote:

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?


Jacob Skaria

Security
 
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
--------------
Jacob Skaria


"ryguy7272" wrote:

Take a look at this:
http://office.microsoft.com/en-us/ex...527191033.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---

--
RyGuy


"Brad" wrote:

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?


John

Security
 
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

--
jb


"Brad" wrote:

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?



All times are GMT +1. The time now is 09:52 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com