Hi, i searched the forum and found a post on how to protect the
workbook, which is what i wanted.
quot;Try Tools -gt; Options -gt; Security tab
to assign passwords to modify or open the workbookquot;
However, i want to be able to open the workbook without entering a
password, but the user can't modify/change anything.
Heres a clearer picture, i got a workbook called A and there are two
macros which leads to this workbook.
1-opens it and locks the workbook for protection
2-need to enter a password to insert layout lines etc.
So does anyone know how to protect the workbook from modify but could
be read? or is there a macro code for it as im making macros (sorry for
the wrong section post if this is a macro case )
thanks in advance,
Bonbon--
Bonbon
------------------------------------------------------------------------
Bonbon's Profile: www.excelforum.com/member.php...oamp;userid=31866
View this thread: www.excelforum.com/showthread...hreadid=535932Not sure if I'm understanding your question correct but....
If you choose from the menu path File / Save As and then from the Save
As dialogue box choose Tools / General Options you will get a dialogue box
that will allow you to enter a password to modify. If you set that all
up....when users open the file they will be prompted to either enter a
password to modify/edit the file OR open the file as read only. That way
users who do not have the password will be able to open the file in a read
mode and user who do have the password will be able to edit the file.
Will this do it for you?
Bill Horton
quot;Bonbonquot; wrote:
gt;
gt; Hi, i searched the forum and found a post on how to protect the
gt; workbook, which is what i wanted.
gt;
gt; quot;Try Tools -gt; Options -gt; Security tab
gt; to assign passwords to modify or open the workbookquot;
gt;
gt; However, i want to be able to open the workbook without entering a
gt; password, but the user can't modify/change anything.
gt; Heres a clearer picture, i got a workbook called A and there are two
gt; macros which leads to this workbook.
gt; 1-opens it and locks the workbook for protection
gt; 2-need to enter a password to insert layout lines etc.
gt;
gt; So does anyone know how to protect the workbook from modify but could
gt; be read? or is there a macro code for it as im making macros (sorry for
gt; the wrong section post if this is a macro case )
gt;
gt; thanks in advance,
gt; Bonbon
gt;
gt;
gt; --
gt; Bonbon
gt; ------------------------------------------------------------------------
gt; Bonbon's Profile: www.excelforum.com/member.php...oamp;userid=31866
gt; View this thread: www.excelforum.com/showthread...hreadid=535932
gt;
gt;
erm the thing is, i dont want t abox to appear asking for pw, i just
need a macro code to lock the whole workbook once workbook is opened so
nobody can modify it.
is there a way?
sorry for the hassle,
Bonbon
William Horton Wrote:
gt; Not sure if I'm understanding your question correct but....
gt; If you choose from the menu path File / Save As and then from the
gt; Save
gt; As dialogue box choose Tools / General Options you will get a dialogue
gt; box
gt; that will allow you to enter a password to modify. If you set that
gt; all
gt; up....when users open the file they will be prompted to either enter a
gt; password to modify/edit the file OR open the file as read only. That
gt; way
gt; users who do not have the password will be able to open the file in a
gt; read
gt; mode and user who do have the password will be able to edit the file.
gt;
gt; Will this do it for you?
gt;
gt; Bill Horton
gt;
gt; quot;Bonbonquot; wrote:
gt;
gt; gt;
gt; gt; Hi, i searched the forum and found a post on how to protect the
gt; gt; workbook, which is what i wanted.
gt; gt;
gt; gt; quot;Try Tools -gt; Options -gt; Security tab
gt; gt; to assign passwords to modify or open the workbookquot;
gt; gt;
gt; gt; However, i want to be able to open the workbook without entering a
gt; gt; password, but the user can't modify/change anything.
gt; gt; Heres a clearer picture, i got a workbook called A and there are two
gt; gt; macros which leads to this workbook.
gt; gt; 1-opens it and locks the workbook for protection
gt; gt; 2-need to enter a password to insert layout lines etc.
gt; gt;
gt; gt; So does anyone know how to protect the workbook from modify but
gt; could
gt; gt; be read? or is there a macro code for it as im making macros (sorry
gt; for
gt; gt; the wrong section post if this is a macro case )
gt; gt;
gt; gt; thanks in advance,
gt; gt; Bonbon
gt; gt;
gt; gt;
gt; gt; --
gt; gt; Bonbon
gt; gt;
gt; ------------------------------------------------------------------------
gt; gt; Bonbon's Profile:
gt; www.excelforum.com/member.php...oamp;userid=31866
gt; gt; View this thread:
gt; www.excelforum.com/showthread...hreadid=535932
gt; gt;
gt; gt;--
Bonbon
------------------------------------------------------------------------
Bonbon's Profile: www.excelforum.com/member.php...oamp;userid=31866
View this thread: www.excelforum.com/showthread...hreadid=535932To lock workbook or worksheets go to Toolsgt;Protectiongt;Protect Workbook or
Protect Worksheet.
Neither of these will lock the workbook from opening, but can protect from
modification.
Should not require a macro. Just save the workbook with protection set to
quot;lockedquot;Gord Dibben MS Excel MVP
On Tue, 25 Apr 2006 11:59:53 -0500, Bonbon
gt; wrote:
gt;
gt;erm the thing is, i dont want t abox to appear asking for pw, i just
gt;need a macro code to lock the whole workbook once workbook is opened so
gt;nobody can modify it.
gt;is there a way?
gt;
gt;sorry for the hassle,
gt;Bonbon
gt;
gt;William Horton Wrote:
gt;gt; Not sure if I'm understanding your question correct but....
gt;gt; If you choose from the menu path File / Save As and then from the
gt;gt; Save
gt;gt; As dialogue box choose Tools / General Options you will get a dialogue
gt;gt; box
gt;gt; that will allow you to enter a password to modify. If you set that
gt;gt; all
gt;gt; up....when users open the file they will be prompted to either enter a
gt;gt; password to modify/edit the file OR open the file as read only. That
gt;gt; way
gt;gt; users who do not have the password will be able to open the file in a
gt;gt; read
gt;gt; mode and user who do have the password will be able to edit the file.
gt;gt;
gt;gt; Will this do it for you?
gt;gt;
gt;gt; Bill Horton
gt;gt;
gt;gt; quot;Bonbonquot; wrote:
gt;gt;
gt;gt; gt;
gt;gt; gt; Hi, i searched the forum and found a post on how to protect the
gt;gt; gt; workbook, which is what i wanted.
gt;gt; gt;
gt;gt; gt; quot;Try Tools -gt; Options -gt; Security tab
gt;gt; gt; to assign passwords to modify or open the workbookquot;
gt;gt; gt;
gt;gt; gt; However, i want to be able to open the workbook without entering a
gt;gt; gt; password, but the user can't modify/change anything.
gt;gt; gt; Heres a clearer picture, i got a workbook called A and there are two
gt;gt; gt; macros which leads to this workbook.
gt;gt; gt; 1-opens it and locks the workbook for protection
gt;gt; gt; 2-need to enter a password to insert layout lines etc.
gt;gt; gt;
gt;gt; gt; So does anyone know how to protect the workbook from modify but
gt;gt; could
gt;gt; gt; be read? or is there a macro code for it as im making macros (sorry
gt;gt; for
gt;gt; gt; the wrong section post if this is a macro case )
gt;gt; gt;
gt;gt; gt; thanks in advance,
gt;gt; gt; Bonbon
gt;gt; gt;
gt;gt; gt;
gt;gt; gt; --
gt;gt; gt; Bonbon
gt;gt; gt;
gt;gt; ------------------------------------------------------------------------
gt;gt; gt; Bonbon's Profile:
gt;gt; www.excelforum.com/member.php...oamp;userid=31866
gt;gt; gt; View this thread:
gt;gt; www.excelforum.com/showthread...hreadid=535932
gt;gt; gt;
gt;gt; gt;
Dear Gord, i have tried the protect workbook many times but everytime i
could still modify it. Then i checked the Window box to try, but that
was not what i wanted. Is there a way to select all the wrksheets? so i
can just 'protect wrksheet' whilst selecting all the sheets or grouping
them because the only protection i got to work, was the protect
wrksheet one, never the protect wrkbook.
Thx
Bon--
Bonbon
------------------------------------------------------------------------
Bonbon's Profile: www.excelforum.com/member.php...oamp;userid=31866
View this thread: www.excelforum.com/showthread...hreadid=535932You have to protect each worksheet one at a time unless you use VBA macro to do
them all at once.
Code for that follows............
Sub ProtectAllSheets()
Application.ScreenUpdating = False
Dim n As Single
For n = 1 To Sheets.Count
Sheets(n).Protect Password:=quot;justmequot;
Next n
Application.ScreenUpdating = True
End Sub
Sub UnprotectAllSheets()
Application.ScreenUpdating = False
Dim n As Single
For n = 1 To Sheets.Count
Sheets(n).Unprotect Password:=quot;justmequot;
Next n
Application.ScreenUpdating = True
End Sub
If not familiar with VBA and macros, see David McRitchie's site for more on
quot;getting startedquot;.
www.mvps.org/dmcritchie/excel/getstarted.htm
In the meantime..........
First...create a backup copy of your original workbook.
To create a General Module, hit ALT F11 to open the Visual Basic Editor.
Hit CRTL R to open Project Explorer.
Find your workbook/project and select it.
Right-click and Insertgt;Module. Paste the code in there. Save the
workbook and hit ALT Q to return to your workbook.
Run the macros by going to Toolgt;Macrogt;Macros.
You can also assign these macros to a button or a shortcut key comboGordOn Tue, 25 Apr 2006 14:57:36 -0500, Bonbon
gt; wrote:
gt;
gt;Dear Gord, i have tried the protect workbook many times but everytime i
gt;could still modify it. Then i checked the Window box to try, but that
gt;was not what i wanted. Is there a way to select all the wrksheets? so i
gt;can just 'protect wrksheet' whilst selecting all the sheets or grouping
gt;them because the only protection i got to work, was the protect
gt;wrksheet one, never the protect wrkbook.
gt;
gt;Thx
gt;Bon
Gord Dibben MS Excel MVP
That worked great, but could you go through each code/instruction and
explain what it means please? because i need to explain it to the user,
thanks.
Bonbon--
Bonbon
------------------------------------------------------------------------
Bonbon's Profile: www.excelforum.com/member.php...oamp;userid=31866
View this thread: www.excelforum.com/showthread...hreadid=535932Sub ProtectAllSheets()
'the name of the Sub
Application.ScreenUpdating = False
'turn off the screen flashing
Dim n As Single
'Set the data type as (single-precision floating-point)
For n = 1 To Sheets.Count
'count the sheets in the workbook
Sheets(n).Protect Password:=quot;justmequot;
'protect the first sheet counted
Next n
'protect the next sheet counted and keep cycling until all sheets are protected
Application.ScreenUpdating = True
'turn screen updating back on
End SubGordOn Wed, 26 Apr 2006 11:10:53 -0500, Bonbon
gt; wrote:
gt;
gt;That worked great, but could you go through each code/instruction and
gt;explain what it means please? because i need to explain it to the user,
gt;thanks.
gt;
gt;Bonbon
Gord Dibben MS Excel MVP
thank you so much! i really appreciate the help.
thx again,
bon--
Bonbon
------------------------------------------------------------------------
Bonbon's Profile: www.excelforum.com/member.php...oamp;userid=31866
View this thread: www.excelforum.com/showthread...hreadid=535932
- Aug 28 Tue 2007 20:38
Workbook protection
close
全站熱搜
留言列表
發表留言