Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 47
Default password protect

I have a sheet that is password protected and is protected
against comments and scenerios but not objects. I wrote a
macro that would unprotect the sheet, alter a few things,
then reprotect it.

Here is the code: Sheets("Time").Unprotect
Password:="TimeFlash" ... then later Sheets
("Time").Protect Password:="TimeFlash"

However, by default, this protects it against comments,
scenerios and objects. I don't want it to protect against
objects. What is the better code?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default password protect

from help on the protect method:

expression.Protect(Password, DrawingObjects, Contents, Scenarios,
UserInterfaceOnly)

so use the appropriate arguments.

--
REgards,
Tom Ogilvy


"scrabtree" wrote in message
...
I have a sheet that is password protected and is protected
against comments and scenerios but not objects. I wrote a
macro that would unprotect the sheet, alter a few things,
then reprotect it.

Here is the code: Sheets("Time").Unprotect
Password:="TimeFlash" ... then later Sheets
("Time").Protect Password:="TimeFlash"

However, by default, this protects it against comments,
scenerios and objects. I don't want it to protect against
objects. What is the better code?



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,624
Default password protect

From XL/VBA Help:

Protect Method
...
Protects a chart or worksheet (Syntax 1)...
Syntax 1
expression.Protect(Password, DrawingObjects, Contents, Scenarios,
UserInterfaceOnly)


So

Sheets("Time").Protect _
Password:="TimeFlash", _
DrawingObjects:=False, _
Contents:=True, _
Scenarios:=True

In article ,
"scrabtree" wrote:

I have a sheet that is password protected and is protected
against comments and scenerios but not objects. I wrote a
macro that would unprotect the sheet, alter a few things,
then reprotect it.

Here is the code: Sheets("Time").Unprotect
Password:="TimeFlash" ... then later Sheets
("Time").Protect Password:="TimeFlash"

However, by default, this protects it against comments,
scenerios and objects. I don't want it to protect against
objects. What is the better code?

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
Password Protect ub Excel Worksheet Functions 1 January 14th 09 04:46 PM
Password Protect Kelly Excel Discussion (Misc queries) 2 January 18th 07 09:52 PM
Password Protect cubsfan Excel Discussion (Misc queries) 0 April 7th 06 03:34 PM
password protect Jim W via OfficeKB.com Excel Discussion (Misc queries) 2 July 24th 05 12:26 AM
Password protect crapit Excel Programming 2 June 13th 04 01:15 PM


All times are GMT +1. The time now is 01:36 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"