Spread 8.0 Documentation
SSGetRefStyle, SSSetRefStyle Functions
Support Options
DLL Reference > DLL Functions > SSGetRefStyle, SSSetRefStyle Functions

Glossary Item Box

SSGetRefStyle, SSSetRefStyle Functions


See Also    ActiveX    Example

Applies To

fpSpread DLL control

Description

Set or return the reference style used by the control to represent formulas and custom names.

Syntax

C

short SSGetRefStyle(HWND hWnd);

short SSSetRefStyle(HWND hWnd, short nStyle);

C++

short TSpread::GetRefStyle( );

short TSpread::SetRefStyle(short nStyle);

Parameters

The SSGetRefStyle function has the following parameter:

Parameter Description
hWnd Window handle of the fpSpread control

The SSSetRefStyle function has the following parameters:

Parameter Description
hWnd Window handle of the fpSpread control
nStyle Reference style
Use one of the following values:
Constant Description Example
SS_REFSTYLE_DEFAULT (Default) Uses letters and numbers for column and row coordinates; letters and numbers represent absolute coordinates; number sign (#) represents the current column or row A1, B#, #2
SS_REFSTYLE_A1 Uses letters and numbers for column and row coordinates, $ for absolute coordinates $A$1, $B, $2, $B2, C$5, D4
SS_REFSTYLE_R1C1 Uses "R" and number for row, "C" and number for column coordinates, [ ] for relative coordinates; "C" or "R" without a number represent the current row or column R1C1, RC2, R4C[3], R[2]C4,
RC[-2]

Remarks

This function is applied to the entire workbook, including all sheets in the control.

The fpSpread control can use relative or absolute references for formulas. The default is absolute references that do not change when copied to another position. The default reference style lets the user indicate the current row or column using the number sign (#).

Choose style SS_REFSTYLE_A1 to provide relative references. The user can also specify absolute references using a dollar sign before the column or row coordinate. This reference style emulates Microsoft® Excel.

Choose style SS_REFSTYLE_R1C1 to use row and column number coordinates and allow relative references, which are specified by brackets.

Your formula cannot contain both absolute and relative row or column references. For example, the following formula to add the values in the first column up to the current row is invalid.

SSSetFormula(hWnd, 1, 1 ,"sum(A1:A#)", TRUE);

Likewise, the following formula to add the values in the first row up to the current column is invalid.

SSSetFormula(hWnd, 1, 1, "sum(A1:#1)", TRUE);

Return Value

SSGetRefStyle: Current reference style.
SSSetRefStyle: Previous reference style.

See Also

Specifying Cell References

SSSetFormula, SSSetFormulaRange functions

ActiveX Correspondence

SSGetRefStyle: GetRefStyle method

SSSetRefStyle: SetRefStyle method

Copyright © GrapeCity, inc. All rights reserved.