GetCell

Returns the data in a cell, as well as the cell’s status.

Tip:

GetCell returns cell data as a Double data type. To return a cell’s data as a formatted string, use GetTextCell.

Syntax

<HsvData>.GetCell(lScenario, lYear, lPeriod, lView, lEntity, lParent, lValue, lAccount, lICP, lCustom1, lCustom2, lCustom3, lCustom4, pdData, plStatus)

Argument

Description

lScenario

Long (ByVal). The member ID of the cell's Scenario dimension member.

lYear

Long (ByVal). The member ID of the cell's Year dimension member.

lPeriod

Long (ByVal). The member ID of the cell's Period dimension member.

lView

Long (ByVal). The member ID of the cell's View dimension member.

lEntity

Long (ByVal). The member ID of the cell's Entity dimension member.

lParent

Long (ByVal). The member ID of the parent of the lEntity argument's entity.

lValue

Long (ByVal). The member ID of the cell's Value dimension member.

lAccount

Long (ByVal). The member ID of the cell's Account dimension member.

lICP

Long (ByVal). The member ID of the cell's Intercompany Partner dimension member.

lCustom1

Long (ByVal). The member ID of the cell's Custom 1 dimension member.

lCustom2

Long (ByVal). The member ID of the cell's Custom 2 dimension member.

lCustom3

Long (ByVal). The member ID of the cell's Custom 3 dimension member.

lCustom4

Long (ByVal). The member ID of the cell's Custom 4 dimension member.

pdData

Double. Returns the data in the cell.

plStatus

Long. Returns the cell’s status. For details on cell statuses, see About Cell Statuses.

Return Value

Integer. Indicates the success of the function call; returns 0 for success or an error code for failure.

Example

The following subroutine populates two Label controls with a cell’s data and status. The subroutine takes the member IDs of the cell’s dimension members. The cell status string is obtained by passing the status Long returned by GetCell to FormatStatusToText.

Sub fillCellLabels(lScen As Long, lYear As Long, lPer As Long, _
   lView As Long, lEnt As Long, lPar As Long, lVal As Long, _
   lAcct As Long, lICP As Long, lCust1 As Long, lCust2 As Long, _
   lCust3 As Long, lCust4 As Long)
Dim cData As HsvData, dData As Double, lStatus As Long
Dim sStatus As String
'g_cSession is an HsvSession object reference
Set cData = g_cSession.Data
cData.GetCell lScen, lYear, lPer, lView, lEnt, _
   lPar, lVal, lAcct, lICP, lCust1, lCust2, _
   lCust3, lCust4, dData, lStatus
sStatus = cData.FormatStatusToText(lStatus)
'Populate the labels
lblData.Caption = dData
lblStatus.Caption = sStatus
End Sub