GetTextCells

Returns Variant arrays containing the data and statuses of cells. GetTextCells also enables you to specify the scaling and the number of decimals for the returned data.

GetTextCells takes arrays of dimension member IDs as arguments; these arrays must contain identical numbers of elements. The elements of these arrays have a one-to-one correspondence to the elements of the arrays that are returned; the first elements of the member ID arrays define the first cell to be returned, the second elements of the member ID arrays define the second cell to be returned, and so on.

Tip:

To return cells’ data in a Double array, use GetCells instead of GetTextCells. To filter out cells that contain no data, zero, derived data, or that consist of invalid intersections, use GetTextCellsWithRowSuppression.

Syntax

<HsvData>.GetTextCells varalScenario, varalYear, varalPeriod, varalView, varalEntity, varalParent, varalValue, varalAccount, varalICP, varalCustom1, varalCustom2, varalCustom3, varalCustom4, sNumDecimals As Integer, sScale As Integer, pvarabstrData, pvaralStatus

Argument

Description

varalScenario

Long array (ByVal). The member IDs of the cells' Scenario dimension members.

varalYear

Long array (ByVal). The member IDs of the cells' Year dimension members.

varalPeriod

Long array (ByVal). The member IDs of the cells' Period dimension members.

varalView

Long array (ByVal). The member IDs of the cells' View dimension members.

varalEntity

Long array (ByVal). The member IDs of the cells' Entity dimension members.

varalParent

Long array (ByVal). The member IDs of the parents of the varalEntity argument's entities.

varalValue

Long array (ByVal). The member IDs of the cells' Value dimension members.

varalAccount

Long array (ByVal). The member IDs of the cells' Account dimension members.

varalICP

Long array (ByVal). The member IDs of the cells' Intercompany Partner dimension members.

varalCustom1

Long array (ByVal). The member IDs of the cells' Custom 1 dimension members.

varalCustom2

Long array (ByVal). The member IDs of the cells' Custom 2 dimension members.

varalCustom3

Long array (ByVal). The member IDs of the cells' Custom 3 dimension members.

varalCustom4

Long array (ByVal). The member IDs of the cells' Custom 4 dimension members.

sNumDecimals

Integer (ByVal). The number of decimal places that the amounts in the pvarabstrData argument’s return value will contain.

To use the application’s default number of decimals, pass the HFMConstants type library constant DEFAULT_NUM_DECIMALS, described in Number Defaults Constants.

sScale

Integer (ByVal). Specifies the degree of scaling to be applied to the return value.

To use the application’s default scaling, pass the HFMConstants type library constant DEFAULT_SCALE, described in Number Defaults Constants.

pvarabstrData

Variant array. Returns the data in the cells identified by the dimension arguments. The array items are returned as a String subtype.

pvaralStatus

Variant array. Returns the calculation statuses of the cells. For details on calculation statuses, see About Cell Statuses.

The array items are returned as a Long subtype.

Example

The following example creates a function that takes arrays of cells’ member IDs and returns the cells’ data scaled by a tenth.

Function scaleCellsByTenth(laScen() As Long, laYear() As _
    Long, laPer() As Long, laView() As Long, laEnt() As Long, _
    laPar() As Long, laVal() As Long, laAcct() As Long, laICP() _
    As Long, laCust1() As Long, laCust2() As Long, laCust3() _
    As Long, laCust4() As Long) _
    As Variant
Dim cData As HsvData, vaData, vaStatus
'g_cSession is an HsvSession object reference
Set cData = g_cSession.Data
cData.GetTextCells laScen, laYear, laPer, laView, laEnt, _
    laPar, laVal, laAcct, laICP, laCust1, laCust2, laCust3, _
    laCust4, DEFAULT_NUM_DECIMALS, 1, vaData, vaStatus
scaleCellsByTenth = vaData
End Function