Share via


TempErr/TempErr12

This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This page may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.

Framework library function that creates a temporary XLOPER/XLOPER12 containing a Microsoft Office Excel worksheet error.

LPXLOPER TempErr(WORD err);
LPXLOPER12 TempErr12(BOOL err);

Parameters

err

The desired error code, or its literal numeric equivalent, as shown in the following table.

Error

Error code defined in XLCALL.H

Decimal equivalent

#NULL

xlerrNull

0

#DIV/0!

xlerrDiv0

7

#VALUE!

xlerrValue

15

#REF!

xlerrRef

23

#NAME?

xlerrName

29

#NUM!

xlerrNum

36

#N/A

xlerrNA

42

Return Value

Returns an xltypeBool containing the error code passed in.

Example

This example uses the TempErr12 function to return a #VALUE! error to Excel.

NoteNote

The Framework library function TempErr12 allocates memory from an internal buffer, which is normally freed when the Framework function Excel12f is called. If this example function is called repeatedly without Excel12f being called, a memory leak occurs.

\SAMPLES\EXAMPLE\EXAMPLE.C

LPXLOPER WINAPI TempErrExample(void)
{
    return TempErr12(xlerrValue);
}

See Also

Concepts

Functions in the Framework Library