Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
vba doesn't trap errors?
excel 2000/vba
i had some code like this: select case passedVariable case "someText" or someVariable & "someText" but no matter what value was passed the above case always executed!!! so then tried it in vb6.0 and the 'or' statement generated a type mismatch error so then in the vba code i tried case "someText" , someVariable & "someText" replacing the 'or' with the ',' (comma) seems to work ok so it seems the bad syntax of using 'or' in the case statement just caused faulty program execution instead of trapping an error???? if this is so, is there some way to turn on error trapping, or test to find syntax and/or other programming errors |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
vba doesn't trap errors?
I am using Excel 2002, and your bad line would not compile for me. I got a
"type mismatch" error. (VBA's OR is a bit-wise OR, and it works only on numeric variables.) On Mon, 9 Aug 2004 18:40:53 -0700, "bbxrider" wrote: excel 2000/vba i had some code like this: select case passedVariable case "someText" or someVariable & "someText" but no matter what value was passed the above case always executed!!! so then tried it in vb6.0 and the 'or' statement generated a type mismatch error so then in the vba code i tried case "someText" , someVariable & "someText" replacing the 'or' with the ',' (comma) seems to work ok so it seems the bad syntax of using 'or' in the case statement just caused faulty program execution instead of trapping an error???? if this is so, is there some way to turn on error trapping, or test to find syntax and/or other programming errors |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Excel Throwing Circular Errors When No Errors Exist | Excel Worksheet Functions | |||
Unresolved Errors in IF Statements - Errors do not show in results | Excel Worksheet Functions | |||
How Do I Trap #VALUE! | Excel Programming | |||
error trap | Excel Programming |