//{{XLP_SRC(OperCellExample)
// NOTE - the FunctionWizard will add and remove mapping code here.
// DO NOT EDIT what you see in these blocks of generated code!
IMPLEMENT_XLLFN2(OperCellExample, "RPHH", "OperCellExample",
"Arg1,Row,Column", "Example", "Demonstrates COper::Cell",
"Argument 1\000Row of cell to extract\000Column of cell to"
" extract\000", "\0\0\0", 1)
extern "C" __declspec( dllexport )
LPXLOPER OperCellExample(const COper* lpopArg1, USHORT usRow,
USHORT usColumn)
{
CXlOper xloResult;
//}}XLP_SRC
BOOL bOk = TRUE;
// Check that we are inspecting an array
bOk = lpopArg1->IsArray();
// Check that the zero-based row and column
// indices are in range
bOk = bOk && (usRow >= 0) && (usColumn >= 0);
bOk = bOk && (usRow < lpopArg1->GetHeight())
&& (usColumn < lpopArg1->GetWidth());
// Extract the one interesting cell
if ( bOk )
xloResult = lpopArg1->Cell(usRow, usColumn);
else
xloResult = xlerrNA;
return xloResult.Ret();
}
Uses
COper::Cell | COper::IsArray