Debugging Macros

fei lac





Return without GoSub.

Return statement exists without a corresponding GoSub statement.


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.


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.


The array is fixed or temporarily locked.

You cannot redimension a fixed length array.


Division by zero.

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


Type mismatch.

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


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