Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Protect Worksheet
I wrote a macro to select certain options when reports on my worksheets are
being printed. The sheets are then protected and when the macro is run, a message appears stating that the commands could be accessed if the password is entered (to remove the protection). How could I get the protection to remain and get the macro to work. Thanks Lennox |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Protect Worksheet
Lennox
If using Excel 2002 or 2003 you have the option when protecting the sheet of allowing users to do certain operations on the sheet. Earlier versions would require a macro to unprotect then re-protect the sheet. ActiveSheet.Unprotect Password:="justme" 'do your stuff ActiveSheet.Protect Password:="justme", DrawingObjects:=True, _ Contents:=True, Scenarios:=True Gord Dibben Excel MVP On Mon, 29 Nov 2004 17:47:05 -0800, LennyG wrote: I wrote a macro to select certain options when reports on my worksheets are being printed. The sheets are then protected and when the macro is run, a message appears stating that the commands could be accessed if the password is entered (to remove the protection). How could I get the protection to remain and get the macro to work. Thanks Lennox |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Protect Worksheet
Hi Gord,
I tried the code which you suggested and it works. Thanks very much. Lennox. "Gord Dibben" wrote: Lennox If using Excel 2002 or 2003 you have the option when protecting the sheet of allowing users to do certain operations on the sheet. Earlier versions would require a macro to unprotect then re-protect the sheet. ActiveSheet.Unprotect Password:="justme" 'do your stuff ActiveSheet.Protect Password:="justme", DrawingObjects:=True, _ Contents:=True, Scenarios:=True Gord Dibben Excel MVP On Mon, 29 Nov 2004 17:47:05 -0800, LennyG wrote: I wrote a macro to select certain options when reports on my worksheets are being printed. The sheets are then protected and when the macro is run, a message appears stating that the commands could be accessed if the password is entered (to remove the protection). How could I get the protection to remain and get the macro to work. Thanks Lennox |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
protect worksheet | Excel Discussion (Misc queries) | |||
Bug re Protect a worksheet | Excel Discussion (Misc queries) | |||
worksheet protect | Excel Worksheet Functions | |||
How to protect a worksheet from being copied to another worksheet | Excel Discussion (Misc queries) | |||
Protect worksheet | Excel Programming |