XLL+ Class Library (7.0)

CXlErrorException Class

An exception which causes a specific error value to be returned to Excel.

class CXlErrorException : public CXlRuntimeException

Overview

Throw an exception of type CXlErrorException to ensure that the desired error code will be returned to Excel.

The following code will return #VALUE! to Excel if x is negative.

CopyC++
if (x < 0)
    throw CXlErrorException(xlerrValue);

Requirements

Header: xlpexcept.h

See Also

CXlErrorException Methods | xlpexcept.h | Exceptions