Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Error handling
Does anyone know the VB code in excel to produce an error message if the
code breaks down. For example if the user doesn't select from a drop down list it tells them to "Select from the list" |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Error handling
On Oct 13, 9:17*pm, "Jim Lavery" wrote:
Does anyone know the VB code in excel to produce an error message if the code breaks down. For example if the user doesn't select from a drop down list it tells them to "Select from the list" Hi Jim, You seem to be talking about two different things here. The example you use is actually Validation, which is generally used to prevent errors from happening. Handling an error after it has happened is a different matter. Which of the two are you actually seeking help on and can you expand the context a little. What are trying to do and do you have some example code you can post? Br, Nick. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Error handling
I have 2 command buttons The first prints the complete IT plan of the
building (About 30 pages) The second asks the user to select from a drop down list the floor & wing & prints that 1 page. If the user doesn't select the Floor/wing but selects that command the code breaks down. If I put in an On error message to handle the error it then gives the message but then goes on to print the 30 pages. "Nick H" wrote in message ... On Oct 13, 9:17 pm, "Jim Lavery" wrote: Does anyone know the VB code in excel to produce an error message if the code breaks down. For example if the user doesn't select from a drop down list it tells them to "Select from the list" Hi Jim, You seem to be talking about two different things here. The example you use is actually Validation, which is generally used to prevent errors from happening. Handling an error after it has happened is a different matter. Which of the two are you actually seeking help on and can you expand the context a little. What are trying to do and do you have some example code you can post? Br, Nick. |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Error handling
On Oct 14, 8:51*pm, "Jim Lavery" wrote:
I have 2 command buttons The first prints the complete IT plan of the building (About 30 pages) The second asks the user to select from a drop down list the floor & wing & prints that 1 page. If the user doesn't select the Floor/wing but selects that command the code breaks down. If I put in an On error message to handle the error it then gives the message but then goes on to print the 30 pages. Not sure if your command buttons are on a sheet or a form, either way it seems odd that the user would need to click a button to be asked to select from a dropdown list. A better way might be set your 'Print' command button's 'Enabled' property to FALSE at design time and have the dropdown (rather than another command button) clearly labelled 'Select Floor/Wing:' Then, in the dropdown's change event, test the length of the dropdown's text or value property. If it's greater than 0 then you set the Print button's enabled property to TRUE otherwise you set it to FALSE (even though you set it to FALSE at design time you still need to set it to FALSE after finding a zero length string in case the user entered a value then deleted it). This is just a loose overview of how you might tackle the problem. If you need more help you'll need to specify whether these command buttons and dropdown are on a VBA Form or a sheet (or a mixture). Br, Nick. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Err.Description as error proc name trail, error handling | Excel Programming | |||
Error handling error # 1004 Run-time error | Excel Programming | |||
Set Error handling INSIDE error-trap | Excel Programming | |||
Error Handling - On Error GoTo doesn't trap error successfully | Excel Programming | |||
Error handling with a handling routine | Excel Programming |