Debugging Macros

fei lac

CODE

ERROR

DESCRIPTION

3

Return without GoSub.

Return statement exists without a corresponding GoSub statement.

5

Invalid procedure call.

The call to another subroutine or function cannot be made. Typically due to a problem with the arguments. Either not calling with a valid number of arguments, or the value of an argument is not valid for the procedure.

9

Subscript out of range.

Attempt was made to access an array element that does not exist. Commonly occurs when you forget that, unless specified, array indexes start at zero.

10

The array is fixed or temporarily locked.

You cannot redimension a fixed length array.

11

Division by zero.

You cannot divide by zero. If the value of the divisor is zero, this error occurs.

13

Type mismatch.

Typically, this means the value passed to a variable is not the correct data type.

35

Sub, Function, or Property not defined.

Occurs when you attempt to call a subroutine, function, or property that does not exist.

0 Type code to execute if specific error occurs.

0 Type Label: replacing Label: with the appropriate label name for the error handling code.

—H Type a conditional statement, such as Select Case, to check the value of the Err.Number object property.

0 Type code to execute if specific error occurs.

^0 Type Resume to return to the line of code where error occurred.

, Switch to Excel and run the macro.

■ If the value passed to the subroutine is not valid, the error processing occurs.

0 0

Post a comment