XLL+ Class Library

CXlMacros::FormulaConvert

Changes the style and type of references in a formula between A1 and R1C1 and between relative and absolute

[C++]
static int FormulaConvert(
   CString& strformula,
   const char* formula_text,
   bool from_a1,
   short int to_a1 = -1,
   unsigned short to_ref_type = 0,
   const CXlOper& rel_to_ref = CXlOper::MissingArg()
);

Parameters

strformula

A reference to a string that will contain the desired data if the function succeeds.

formula_text

Formula_text is the formula, given as text, containing the references you want to change.

from_a1

From_a1 is a logical value specifying whether the references in formula_text are in A1 or R1C1 style.

to_a1

To_a1 is a logical value specifying the form for the references FORMULA.CONVERT returns. A value of -1 is treated as a missing argument, A value greater than 0 is treated as TRUE, and 0 is treated as FALSE.

to_ref_type

To_ref_type is a number from 1 to 4 specifying the reference type of the returned formula. A value of 0 is treated as a missing argument, A value greater than 0 is treated normally.

rel_to_ref

Rel_to_ref is an absolute reference that specifies what cell the relative references are or should be relative to.

Return value

Zero if the function has been called successfully; non-zero if the function could not be called. See Error codes for a list of return values.

Remarks

See the Microsoft Excel on-line Help for full details about this function.

Requirements

Header: xlfuncs.h

See Also

CXlMacros Class | CXlMacros Methods