GetCells

Returns the data and statuses of cells. GetCells returns the cells’ data in one array and the statuses in a second array. The array containing the cells’ data is returned as a Double.

GetCells 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 Variant array, use GetTextCells instead of GetCells. To filter out cells that contain no data, zero, derived data, or that consist of invalid intersections, use GetCellsWithRowSuppression.

Syntax

<HsvData>.GetCells varalScenario, varalYear, varalPeriod, varalView, varalEntity, varalParent, varalValue, varalAccount, varalICP, varalCustom1, varalCustom2, varalCustom3, varalCustom4, pvaradData, 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.

pvaradData

Variant array. Returns the data in the cells. The array items are returned as a Double subtype.

pvaralStatus

Variant array. Returns the cells’ statuses. For details on cell statuses, see About Cell Statuses.

The array items are returned as a Long subtype.

Example

The following subroutine populates a ListBox controls with the data and status of the cells specified with the subroutine’s arguments. The cell status strings are obtained by passing the status Longs returned by GetCells to FormatStatusToText.

Sub fillCellsLists(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)
Dim cData As HsvData, vaData, vaStatus
'g_cSession is an HsvSession object reference
Set cData = g_cSession.Data
cData.GetCells laScen, laYear, laPer, laView, laEnt, _
    laPar, laVal, laAcct, laIcp, laCust1, laCust2, laCust3, _
    laCust4, vaData, vaStatus
'Populate the list box
For i = LBound(vaData) To UBound(vaData)
lstDataStatus.AddItem vaData(i) & " - " & _
    cData.FormatStatusToText(vaStatus(i))
Next i
End Sub