View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default Excessing excel error responses

I don't think you're going to squeeze your subroutine in with any of excel's
events.

But as an alternative, why not stop the users from selecting cells that are
locked on that protected sheet.

If you protect the worksheet in code, you can toggle this setting:

Sub Auto_Open()
With Worksheets("Sheet99999")
.Unprotect Password:="hi"
.EnableSelection = xlUnlockedCells
.Protect Password:="hi", DrawingObjects:=True, _
Contents:=True, Scenarios:=True
End With
End Sub

In fact, in xl2k and below, this setting isn't remembered when you close the
workbook and reopened. Setting it in code was the only way to do this.

BRG wrote:

I have written a subroutine that is to respond to an excel error when the
user of my spreadsheet tries to change the value of a cell that has been
locked and protected. I am having trouble trying to access the event to call
the routine. Does anyone have any tips on how to access this response?
Also, I'd like to override excel's response (in the form of an error box) and
replace it with my own. Is this possible?
--
BRG


--

Dave Peterson