Share via


Excel/Excel12f

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 functions. Excel is a wrapper for the Excel4 function. Excel12f is a wrapper for the Excel12 function. Each checks to see that none of the arguments is zero, which would indicate that the creation of a temporary XLOPER or XLOPER12 failed. If an error occurs, each prints a debug message. When finished, each frees all temporary memory that might have been created for temporary XLOPERs and XLOPER12s.

Excel12f can only be called from a DLL created using the Microsoft Office Excel 2007 C API library. Furthermore, it only works when running with Excel 2007, and fails with xlretFailed otherwise.

int Excel(int iFunction, LPXLOPER pxRes, int iCount, 
LPXLOPER argument1, ...);
int Excel12f(int iFunction, LPXLOPER12 pxRes, int iCount, 
LPXLOPER12 argument1, ...);

Parameters

iFunction (int)

A number indicating the command or function you want to call. For more information, see Excel4/Excel12.

pxRes

A pointer to result of the evaluated function. Any memory pointed to in the result will have been allocated by Excel and should be freed in a call to xlFree once it is no longer needed, or by setting xlbitXLFree if returning it to Excel.

iCount (int)

The number of arguments that will be passed to the function. In Excel 2007, the limit is 255 arguments. In earlier versions, the limit is 30.

argument1, ...

The optional arguments to the function. All arguments must be pointers to XLOPERs in the case of Excel, or XLOPER12s in the case of Excel12f.

Return Value

Both functions return the same error and success codes as Excel4, Excel4v, Excel12, and Excel12v. See Excel4/Excel12 for a full description of these codes. In addition, these Framework functions return xlretFailed without calling the C API if a NULL pointer to a parameter is detected.

Example

This example passes a bad argument to the Excel12f function, which sends a message to the debugger.

\SAMPLES\EXAMPLE\EXAMPLE.C

short WINAPI Excel12fExample(void)
{
    Excel12f(xlcDisplay, 0, 1, 0);
    return 1;
}

See Also

Reference

Excel4/Excel12

Concepts

Functions in the Framework Library