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

User chooses their workbooks and as they open, a sub
(VlnSearchAndProtect) is called, and acts on each sheet
in each book, in turn. I'm fairly sure it's working.

I need to allow users the facility to unprotect (most)
sheets/books which they have opened (and on which
that sub has operated). So I have a little routine which
does that.

There is then the need to reprotect the open books and
sheets. So I have this routine:

Sub AddProtection() 'All sheets in all open Workbooks
Dim ws As Worksheet, wkbk As Workbook
Application.ScreenUpdating = False
For Each wkbk In Workbooks
Application.ScreenUpdating = False
With wkbk
.Activate
'set the level of protection appropriate
'to each type of workbook and sheet
Call VlnSearchAndProtect
Application.ScreenUpdating = False
For Each ws In ActiveWorkbook.Worksheets
With ws
.Protect
.EnableSelection = xlUnlockedCells
End With
Next
End With
Next
Application.ScreenUpdating = True
End Sub

The protection 'appears' to be set by the Protect
routine, but not the Unlocked cells.

Can you help, please?

Regards.


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.700 / Virus Database: 457 - Release Date: 06/06/2004


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
Macro protection problems Joe M. Excel Discussion (Misc queries) 1 January 25th 10 09:10 PM
Excel Data Protection- AKA: Sheet/Macro Password Protection Mushman(Woof!) Setting up and Configuration of Excel 0 December 29th 09 06:50 AM
Problems with cell protection-Excel 2002 SP3 -charles- Excel Discussion (Misc queries) 0 July 21st 09 01:56 AM
Cell Protection Problems KLion Excel Discussion (Misc queries) 0 November 27th 07 09:01 PM
Command Button protection problems???? Chris Watson Excel Worksheet Functions 3 February 25th 06 03:24 PM


All times are GMT +1. The time now is 12:42 PM.

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

About Us

"It's about Microsoft Excel"