View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson[_3_] Dave Peterson[_3_] is offline
external usenet poster
 
Posts: 2,824
Default Disable Protection Messages

I made a small correction to your code (activesheet in place of Active):

Private Sub Worksheet_Activate()
ActiveSheet.Protect
ActiveSheet.EnableSelection = xlUnlockedCells
End Sub

And I didn't get the warning message when I clicked on any cell, I couldn't
select it.

And you might want to just stop all selections. From Xl2002 vba's help:

XlEnableSelection can be one of these XlEnableSelection constants.
xlNoSelection
xlNoRestrictions
xlUnlockedCells


But xlnoselection and xlunlocked (with no unlocked cells) behaved the same way
for me.


Cathy Myers wrote:

Hi,

I have worked around this problem by using the following
bit of code:

Private Sub Worksheet_Activate()
ActiveSheet.Protect
Active.EnableSelection = xlUnlockedCells
End Sub

When the user double-clicks on a locked cell, an unlocked
cell is selected, and no messages are displayed.

My problem is however that I have some sheets that have no
unlocked cells. These are explanatory sheets that do not
require input. Since there are no unlocked cells to be
selected on a double-click, the message about protection
pops up. Does anyone have any ideas about a work-around?
Thanks in advance.

Yours,
C.M.

-----Original Message-----
Hi,

I am on Windows 2000, Office XP, and VB 6.3. My users

will
be on Excel 97. I have protected my sheets so that the
users are unable to select locked cells (using code).
However, on Excel 97, whenever a cell is double-clicked,

a
message pops up telling the user that the sheet has been
protected and giving him instructions on how to unprotect
the sheet. How do I disable this message? Thanks in
advance.

Yours,
C.M.
.


--

Dave Peterson