View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
deltree[_3_] deltree[_3_] is offline
external usenet poster
 
Posts: 1
Default Sheet protection error msg - Unrequested sheet activation

Hello,

I have designed one worksheet in my workbook to be completely
read-only, by protecting the sheet so that no cells can be selected
(EnableSelection = xlNoSelection).

As expected, when the user doubleclicks the sheet (to try to edit a
cell), this message is displayed:

"The cell or chart you are trying to change is protected and
therefore read-only..."

Showing the above message is fine, but when the user clicks "OK", Excel
automatically selects/activates another sheet -- an internal data sheet
that the user is never supposed to see! Coincidentally, Excel always
selects the Sheet1 worksheet object, which is not necessarily the first
sheet listed in the sheet tabs.

How can I get Excel to stop selecting this different sheet whenever the
error message is displayed??

Alternatively, is there a way that I can specify which sheet Excel
automatically selects?

Any help or advice would be greatly appreciated.

Thanks,
Deltree

P.S. I've tried adding code that turns off Application.DisplayUpdates
to the Worksheet_BeforeDoubleClick subroutine, but this does not stop
the error message from showing or the unrequested sheet change.


---
Message posted from http://www.ExcelForum.com/