XLL+ Class Library (6.3)

CXlOper::MakeRefIntl

Creates a reference from an address in English

BOOL MakeRefIntl(
   const TCHAR* pszAddress,
   BOOL bA1 = TRUE,
   BOOL bLocal = FALSE
);

Parameters

pszAddress

The address of a cell or range of cells.

This can include a worksheet name, in "[book]sheet" format. If the worksheet name is omitted, the address will be assumed to be in the worksheet of the cell from which the current add-in function was called.

The following addresses are all valid

    [Book1.xls]Sheet2!A2
    [Book1.xls]Sheet2!A1:C3
    [Book1.xls]Sheet2!R1C5
    A2

The address can also contain a named range.

Note that if RC style addresses are used, they should always use the letters "R" anc "C" for row and column respectively, e.g.: "R1C1" for cell A1.

bA1

TRUE if the address is in A1 format; FALSE if the address is in R1C1 format.

bLocal

If bLocal is TRUE then the reference will always be external, i.e. it will include a sheet ID and IsMRef() will return TRUE. If bLocal is FALSE then the reference will only be external if it refers to a sheet other than the current sheet. If it refers to the current sheet, then it will not include a sheet ID and IsSRef() will return TRUE.

Return Value

Returns TRUE if the function was successful, FALSE if it failed. The function can fail if the address string is not valid for any reason.

Remarks

This function will create a reference from a string address. The reference can then be used to access the contents of the cell, for example with the methods SetValue() and Coerce(). The function will fail if the address is not found.

International considerations

Be aware when creating a reference using this method that the address should be formatted as if for the English language version of Excel. This has no impact on "A1" style adresses, but "RC" style addresses should always use the letters "R" anc "C" for row and column respectively, e.g.: "R1C1" for cell A1.

Alternatively, you can use CXlOper::MakeRef to create addresses for the current Excel language version.

See Using references and Setting formulae in the User Guide for more information.

Requirements

Header: xllplus.h

See Also

CXlOper Class | CXlOper Methods | CXlOper::MakeRef() | CXlOper::FromMRef() | CXlOper::FromSRef() | CXllApp::MakeSheetName()