Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
brg brg is offline
external usenet poster
 
Posts: 15
Default Excessing excel error responses

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
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
  #3   Report Post  
Posted to microsoft.public.excel.programming
brg brg is offline
external usenet poster
 
Posts: 15
Default Excessing excel error responses

Thanks for the idea Dave. I have one problem with that if you can think of a
way around it.

The cells that are locked are linked to control toolbar option buttons and
check boxes. The original problem was that when the user tries to change a
selection for a column of locked buttons, the graphic of the button changes
(from selected to unselected or visa versa) but the value in the linked cell
(which is used for calculations) doesn't. The subroutine I have since
written goes through the OLE objects in the sheet and sets their value equal
to the value in their linked cell, so I'm now looking for an event that will
call the subrouting.

Maybe as an alternative along the lines of your suggestion, is there a way
to make the control toolbar objects unselectable?

--
BRG


"Dave Peterson" wrote:

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

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Excessing excel error responses

Link to a cell in another (hidden) worksheet and use a formula to retrieve that
value.

Or...

Drop the linked cell business and use code to put the value back in the cell.

You can protect a sheet in code
Worksheets("sheet1").Protect Password:="hi", userinterfaceonly:=True

Then you can do lots of things in code that the user can't do. (Or just
unprotect, do the work and reprotect.)

BRG wrote:

Thanks for the idea Dave. I have one problem with that if you can think of a
way around it.

The cells that are locked are linked to control toolbar option buttons and
check boxes. The original problem was that when the user tries to change a
selection for a column of locked buttons, the graphic of the button changes
(from selected to unselected or visa versa) but the value in the linked cell
(which is used for calculations) doesn't. The subroutine I have since
written goes through the OLE objects in the sheet and sets their value equal
to the value in their linked cell, so I'm now looking for an event that will
call the subrouting.

Maybe as an alternative along the lines of your suggestion, is there a way
to make the control toolbar objects unselectable?

--
BRG

"Dave Peterson" wrote:

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


--

Dave Peterson
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
How do I create a Graphical Report from Survey responses in Excel Jon Peltier Excel Programming 0 January 18th 08 12:15 AM
How do I create a Graphical Report from Survey responses in Excel ajc Excel Programming 0 January 17th 08 11:24 PM
Automating application error responses Mekinnik Excel Programming 2 October 8th 07 06:23 PM
How can I put in a control box in Excel for Yes/No responses? Mary A Walthall Excel Discussion (Misc queries) 4 January 31st 07 01:16 PM
Taking information out of excel and making a table of responses in stanger help Excel Programming 0 December 21st 05 02:12 AM


All times are GMT +1. The time now is 06:27 PM.

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"