This function can be used to determine the highest occupied index of an array. Note that arrays are increased in addressable indices automatically, thus it is not an error to use a higher index that the value returned by the function UBOUND. On the other hand all the element having index larger than the returned value are undef.
The argument of this function has to be an array. If the argument is an ordinary value, or a variable that is not an array the value returned by the function will be undef.
UBOUND(undef) is undef or raises an error if the option RaiseMatherror is set in bit sbMathErrUndef.
See also LBOUND.