Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Avoid protected cell warning on BeforeDoubleClick WS event
I am creating an event scheduling worksheet. A grid is generated with days
of the month x-axis and users y-axis. Where an event occurs this is logged by a hidden event ID in the appropriate day cell. In order to prevent this ID from being overwritten I protect the worksheet. What I am trying to do is have a worksheet DoubleClick event which either. 1) Captures the event ID in the underlying cell, and opens a custom form for editing the event, or 2) Recognises that no event exists and opens a custom form for logging a new event. What I have tried is to unprotect the worksheet at the start of my procedure and then protect it following the code Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean) Dim lActiveColumn As Long, lActiveDay As Long Dim dActiveMonthDate As Date ActiveSheet.Unprotect lActiveColumn = Target.Column lActiveDay = Cells(4, lActiveColumn).Value dActiveMonthDate = Cells(1, (lActiveColumn - (lActiveDay - 1))).Value If Target.Value = 0 Then MsgBox ("DATE:" & lActiveDay & "/" & Month(dActiveMonthDate) & "/" & Year(dActiveMonthDate)) Else MsgBox ("EVENT ID: " & Target.Value) End If ActiveSheet.Protect End Sub But the warning message still appears. Is there a method of disabling this warning message temporarily, or is there another method which may be more suitable?, I considered BeforeRightClick but this results in the context menu appearing after the code has executed. Any advice and/or alternative solutions appreciated Thanks in advance Matt |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
BeforeDoubleClick Event not working | Excel Programming | |||
BeforeDoubleClick on Protected Sheet | Excel Programming | |||
How to avoid warning pop-up dialog boxes | Excel Programming | |||
avoid warning when removing sheet | Excel Programming | |||
Replace a warning message...on protected cell | Excel Programming |