Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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
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
BeforeDoubleClick Event not working Ayo Excel Programming 2 March 10th 10 07:21 PM
BeforeDoubleClick on Protected Sheet Paul Excel Programming 2 October 8th 09 10:44 AM
How to avoid warning pop-up dialog boxes Andrew[_56_] Excel Programming 3 May 23rd 08 08:56 PM
avoid warning when removing sheet Tijmen Excel Programming 2 December 28th 05 03:10 PM
Replace a warning message...on protected cell mika Excel Programming 2 August 12th 04 01:30 PM


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