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


I have a macro to automatically protect my sheets. This macro i
designed to only allow the selection of Unlocked Cells.

ActiveSheet.Protect "a"
ActiveSheet.EnableSelection = xlUnlockedCells

It works fine for every sheet I've used it on up until I re-load i
after I've saved it. (Namely, the locked cells can't be selected, bu
the unlocked ones can.)

When I re-open the workbook, the sheet is still protected, but I ca
select Locked Cells and Unlocked Cells. (Only the Unlocked ones can b
editted, of course.)

Does anyone know of a way to fix this? ie. Change my macro so tha
this problem does not occur?

Thanks,
Scot

--
Maistry
-----------------------------------------------------------------------
Maistrye's Profile: http://www.excelforum.com/member.php...fo&userid=3607
View this thread: http://www.excelforum.com/showthread.php?threadid=56619

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Sheet Protection

You must run it everytime you open the workbook
Copy it in the workbook open event

See
http://www.cpearson.com/excel/events.htm




--
Regards Ron de Bruin
http://www.rondebruin.nl



"Maistrye" wrote in message
...

I have a macro to automatically protect my sheets. This macro is
designed to only allow the selection of Unlocked Cells.

ActiveSheet.Protect "a"
ActiveSheet.EnableSelection = xlUnlockedCells

It works fine for every sheet I've used it on up until I re-load it
after I've saved it. (Namely, the locked cells can't be selected, but
the unlocked ones can.)

When I re-open the workbook, the sheet is still protected, but I can
select Locked Cells and Unlocked Cells. (Only the Unlocked ones can be
editted, of course.)

Does anyone know of a way to fix this? ie. Change my macro so that
this problem does not occur?

Thanks,
Scott


--
Maistrye
------------------------------------------------------------------------
Maistrye's Profile: http://www.excelforum.com/member.php...o&userid=36078
View this thread: http://www.excelforum.com/showthread...hreadid=566192



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Sheet Protection


I can see that would work, but that's not what I'm looking for. I don't
want to put macros into the workbooks that I'm working on, I'm merely
attempting to mimic the behavior of:

Tools - Protection - Protect Sheet ...
--- Unselecting "Select Locked Cells"
--- Selecting "Select Unlocked Cells"

When doing it through the menu, the next time the worksheet is loaded,
the sheet has the same protection as I initially set it up with.

Currently, my macro is sitting in Personal.xls and is attached to a
button on my desktop which I have set up to toggle the protection on my
worksheet.

And no, it is not a requirement for the work I'm doing, just my own
preference for worksheets where Locked Cells are not selectable.

Thanks,
Scott

Ron de Bruin Wrote:
You must run it everytime you open the workbook
Copy it in the workbook open event

See
http://www.cpearson.com/excel/events.htm




--
Regards Ron de Bruin
http://www.rondebruin.nl



I have a macro to automatically protect my sheets. This macro is
designed to only allow the selection of Unlocked Cells.

ActiveSheet.Protect "a"
ActiveSheet.EnableSelection = xlUnlockedCells

It works fine for every sheet I've used it on up until I re-load it
after I've saved it. (Namely, the locked cells can't be selected,

but
the unlocked ones can.)

When I re-open the workbook, the sheet is still protected, but I can
select Locked Cells and Unlocked Cells. (Only the Unlocked ones can

be
editted, of course.)

Does anyone know of a way to fix this? ie. Change my macro so that
this problem does not occur?

Thanks,
Scott




--
Maistrye
------------------------------------------------------------------------
Maistrye's Profile: http://www.excelforum.com/member.php...o&userid=36078
View this thread: http://www.excelforum.com/showthread...hreadid=566192

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Sheet Protection

Hi Maistrye

Tools - Protection - Protect Sheet ...
--- Unselecting "Select Locked Cells"
--- Selecting "Select Unlocked Cells"

Only in Excel 2002 and 2003

This is working for me in 2002-2003

ActiveSheet.EnableSelection = xlUnlockedCells
ActiveSheet.Protect "ron"



--
Regards Ron de Bruin
http://www.rondebruin.nl



"Maistrye" wrote in message
...

I can see that would work, but that's not what I'm looking for. I don't
want to put macros into the workbooks that I'm working on, I'm merely
attempting to mimic the behavior of:

Tools - Protection - Protect Sheet ...
--- Unselecting "Select Locked Cells"
--- Selecting "Select Unlocked Cells"

When doing it through the menu, the next time the worksheet is loaded,
the sheet has the same protection as I initially set it up with.

Currently, my macro is sitting in Personal.xls and is attached to a
button on my desktop which I have set up to toggle the protection on my
worksheet.

And no, it is not a requirement for the work I'm doing, just my own
preference for worksheets where Locked Cells are not selectable.

Thanks,
Scott

Ron de Bruin Wrote:
You must run it everytime you open the workbook
Copy it in the workbook open event

See
http://www.cpearson.com/excel/events.htm




--
Regards Ron de Bruin
http://www.rondebruin.nl



I have a macro to automatically protect my sheets. This macro is
designed to only allow the selection of Unlocked Cells.

ActiveSheet.Protect "a"
ActiveSheet.EnableSelection = xlUnlockedCells

It works fine for every sheet I've used it on up until I re-load it
after I've saved it. (Namely, the locked cells can't be selected,

but
the unlocked ones can.)

When I re-open the workbook, the sheet is still protected, but I can
select Locked Cells and Unlocked Cells. (Only the Unlocked ones can

be
editted, of course.)

Does anyone know of a way to fix this? ie. Change my macro so that
this problem does not occur?

Thanks,
Scott




--
Maistrye
------------------------------------------------------------------------
Maistrye's Profile: http://www.excelforum.com/member.php...o&userid=36078
View this thread: http://www.excelforum.com/showthread...hreadid=566192



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
Excel Data Protection Best Practice: AKA: Real Sheet Protection Mushman(Woof!)[_2_] Excel Discussion (Misc queries) 4 December 30th 09 01:20 AM
Excel Data Protection- AKA: Sheet/Macro Password Protection Mushman(Woof!) Setting up and Configuration of Excel 0 December 29th 09 06:50 AM
sheet protection pmss Excel Discussion (Misc queries) 1 January 2nd 08 11:43 AM
Protection sheet henpat Excel Programming 1 November 14th 05 01:04 PM
Sheet protection error msg - Unrequested sheet activation deltree[_3_] Excel Programming 0 January 28th 04 06:20 PM


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