Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Override protected sheet message?
My sheet is "protected". The user is only allowed to select
locked or unlocked cells. If a user tries to double click on any cell or change data, Excel shows the following message box: "The cell or chart that you are trying to change is protected and therefore read-only." Does anyone know if it's possible to override this default message box? It would be nice if I could display my own custom message box, or run my own subroutine if a user tries to change data on a protected sheet. I doubt it's possible, but I just want to check if anyone here knows how to do this?? Thank you! Robert |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Override protected sheet message?
You can trap the user double-clicking cells in the
Worksheet_BeforeDoubleClick event. Here, you can display your own message and cancel Excel's notification message (Cancel = True). -- Garry Free usenet access at http://www.eternal-september.org Classic VB Users Regroup! comp.lang.basic.visual.misc microsoft.public.vb.general.discussion |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Override protected sheet message?
GS has brought this to us :
You can trap the user double-clicking cells in the Worksheet_BeforeDoubleClick event. Here, you can display your own message and cancel Excel's notification message (Cancel = True). Note, however, that this approach doesn't trap if the user presses the F2 key. Use Application.OnKey to enable/disable this shortcut while your app is running... At startup: Application.OnKey "{F2}", "" '//disable OR Application.OnKey "{F2}", "TrapCellEditing" '//run your code ...and be sure to reset it at shutdown... Application.OnKey "{F2}" '//reset to normal behavior In your Worksheet_BeforeDoubleClick event you can redirect to the same procedure... Cancel = True: Call TrapCellEditing -- Garry Free usenet access at http://www.eternal-september.org Classic VB Users Regroup! comp.lang.basic.visual.misc microsoft.public.vb.general.discussion |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Override protected sheet message?
"GS" wrote:
You can trap the user double-clicking cells in the Worksheet_BeforeDoubleClick event. Here, you can display your own message and cancel Excel's notification message (Cancel = True). Outstanding! Thanks again for your expertise Garry! |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Override protected sheet message?
Robert Crandal has brought this to us :
"GS" wrote: You can trap the user double-clicking cells in the Worksheet_BeforeDoubleClick event. Here, you can display your own message and cancel Excel's notification message (Cancel = True). Outstanding! Thanks again for your expertise Garry! Always happy to help, Robert! -- Garry Free usenet access at http://www.eternal-september.org Classic VB Users Regroup! comp.lang.basic.visual.misc microsoft.public.vb.general.discussion |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
2007 Ribbon control disabled by Excel when sheet is protected - Override with getEnabled? | Excel Programming | |||
Relacing default Excel message box when user attempts to change locked cell on protected sheet. | Excel Programming | |||
Intercept/replace standard 'cell protected' message with my own message? | Excel Programming | |||
Protected Sheet Message | Excel Discussion (Misc queries) | |||
Error message with protected sheet | Excel Discussion (Misc queries) |