HypRetrieveRange

Data provider types: Oracle Essbase, Oracle Hyperion Planning (ad hoc only), Oracle Planning and Budgeting Cloud (ad hoc only), Oracle Hyperion Financial Management (ad hoc only), Oracle Hyperion Enterprise® (ad hoc only)

Description

HypRetrieveRange() enables users to refresh a selected or named range of cells in a grid or worksheet. The selected or named range of cells should form a valid grid layout. If the range specified for this function contains more rows or columns than the actual grid has, the additional rows and columns are treated as comments and are thus part of the grid.

HypRetrieveRange clears the Undo buffer, therefore the Undo operation cannot be used afterward.

Essbase only: To refresh or create a multiple-grid sheet, use HypCreateRangeGrid. Starting in release 11.1.2.5.610, the behavior of the HypRetrieveRange VBA function is changed to only refresh the selected range. In 11.1.2.5.610 and later, it will no longer create multiple-grid sheets or create additional ranges.

Syntax

HypRetrieveRange(vtSheetName,vtRange,vtFriendlyName)

ByVal vtSheetName As Variant

ByVal vtRange As Variant

ByVal vtFriendlyName As Variant

Parameters

vtSheetName: The name of worksheet on which to run the function. If vtSheetName is Null or Empty, the active worksheet is used.

vtRange: The continuous range to be refreshed. This range must contain one or more member cells as well as data cells. If vtRange is Null, the entire worksheet is refreshed, and GetUsedRange is used on the worksheet specified to get the range to be refreshed.

vtFriendlyName: The friendly name of the connection to be used to refresh the range. If set to Null, the active connection associated with the worksheet is used to refresh the range on that worksheet. If no connection is associated, an error is returned.

Return Value

Returns 0 if successful; otherwise, returns the appropriate error code.

Example

This example assumes that the required data sources are already connected.

Public Declare Function HypRetrieveRange Lib "HsAddin" (ByVal vtSheetName As Variant, ByVal vtRange As Variant, ByVal vtFriendlyName As Variant) As Long
Worksheets("Sheet2").Names.Add name:="MyRange", RefersTo:="=$E$11:$F$28"
Sub Example_RetrieveRange
   Worksheets("Sheet1").Names.Add name:="MyRange", RefersTo:="=$E$11:$F$28"
   sts = HypRetrieveRange(Empty, range("E11:F28"), "Samp1")
      'retrieve by regular range
   sts = HypRetrieveRange(Empty, range("MyRange"), "Samp1")
      'retrieve by named range
End sub