#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 846
Default 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?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,836
Default 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?

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,520
Default 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?

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,069
Default 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?

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Security dwake Excel Discussion (Misc queries) 5 December 21st 09 09:02 PM
Security dwake Excel Discussion (Misc queries) 1 December 16th 09 04:28 PM
VBE Security GB Excel Programming 1 July 11th 07 08:02 PM
security kyoshirou Excel Discussion (Misc queries) 5 July 3rd 07 06:27 AM
Security The Rook[_2_] Excel Discussion (Misc queries) 4 May 9th 07 03:12 PM


All times are GMT +1. The time now is 01:10 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"