Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Run-time error '9' - doesn't occur when unallocated array is Watch
OK, this is one I have no idea about.
Example code as follows: Sub test() Dim myArray() As Range Debug.Print LBound(myArray) End Sub 1. If I run this sub, I get a run-time error '9' (obviously...). 2. If I step into this sub, I get the same run-time error '9'. 3. If I add a watch to the variable myArray and have it visible in the Watches window and then run the sub, I get the run-time error '9'. 4. BUT - If I add a watch to the variable myArray and have it visible in the watches window and then STEP INTO the sub, I DO NOT get the run-time error '9'. Instead, the value of 0 is output to the Immediate window. This might seem trivial, but it's proving a bit irritating when I'm trying to debug a larger project. Also, it's just a puzzler and I'd love to know what on earth is going on!!! Thanks to anybody for help. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Error occur while loading Sheet1811111111111111111" Help Please! | Excel Programming | |||
Error occur while loading Sheet1811111111111111111" HELP!! | Excel Discussion (Misc queries) | |||
Please help - Looking for a way to sum up for specific error codes that occur in multiple months. | Excel Discussion (Misc queries) | |||
Web query - when does error occur so I can trap it? | Excel Programming | |||
VBA occur error - kernel32.dll | Excel Programming |