XLL+ Class Library (6.3)

CXlOper::RetString

Returns a string value to Excel

static CXlOper* RetString(
   const char* lpszFormat,
    ...
);
static CXlOper* RetString(
   const wchar_t* lpszFormat,
    ...
);

Parameters

lpszFormat

A string template, which may include tokens preceded by %, like printf.

...

The remaining arguments to the function will be substituted into the returned string, as in the standard C library function printf. Arguments of type CString should be cast to (const char*) or (const wchar_t*) as appropriate.

Return Value

This function returns a pointer to some static memory containing a string.

Remarks

This static function can be used to return a CXlOper result containing a string from an add-in function, instead of CXlOper::Ret().

For example:

if (input < 0)
    return CXlOper::RetString("#Error: input (%lf) must be >= 0", input);

Requirements

Header: xllplus.h

See Also

CXlOper Class | CXlOper Methods | CXlOper::Ret() | CXlOper::RetError()