Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Error trap with object variable problem
Hello, I have a macro with a series of different error traps which are set
at appropriate points in a loop. The errors I want to trap are when the Find method doesn't find what it's looking for. The code I use looks like this: ' Find the Oracle RefNo & Assignment from the EmpNo sheet On Error GoTo ErrorTrap EmpNoRow = EmpNoSheet.Columns("C:C").Find(What:=InDataSheet.C ells(InDataRow, 3)).Row there is a value in the specified cell, and all of the object variables are appropriately set. The code works fine when the value is found, but when it is missing it displays the Debug dialog box (which is exacly what I want to trap) . It says: Run time Error 91 - Object variable or with block not set. Strangely though, sometimes my error traps do work with identical code. Any ideas? Thanks |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Runtime Error '91' Object variable or With block variable not set | Excel Discussion (Misc queries) | |||
Object Variable Not Set Error on Selection object | Excel Worksheet Functions | |||
Object variable problem | Excel Programming | |||
Error 91 - Object variable with block variable not set | Excel Programming | |||
Problem Using an Object Variable in a Class Definition | Excel Programming |