Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22,906
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default 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
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
protect worksheet Selen Excel Discussion (Misc queries) 3 April 29th 10 03:56 PM
Bug re Protect a worksheet Kevin Excel Discussion (Misc queries) 1 January 23rd 08 09:26 PM
worksheet protect jnu Excel Worksheet Functions 2 March 23rd 06 01:35 PM
How to protect a worksheet from being copied to another worksheet SurvivorIT Excel Discussion (Misc queries) 3 August 31st 05 01:53 PM
Protect worksheet madcat[_9_] Excel Programming 1 August 30th 04 02:46 AM


All times are GMT +1. The time now is 03:31 AM.

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

About Us

"It's about Microsoft Excel"