HypRetrieveRange

Data source types: Essbase, Planning (ad hoc only), Financial Management (ad hoc only), Hyperion Enterprise (ad hoc only)

Description

HypRetrieveRange() gives users the ability to refresh a selected or named range of cells in a grid or worksheet. If the range provided to 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.

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

Syntax

HypRetrieveRange(vtSheetName,vtRange,vtConnName)

ByVal vtSheetName As Variant

ByVal vtRange As Variant

ByVal vtConnectionName As Variant

Parameters

vtSheetName: For future use. Currently the active sheet is used.

vtRange: Single continuous range to be refreshed. If vtRange is Null, the entire worksheet is refreshed, and GetUsedRange is used on the worksheet specified to get the range to be refreshed.

vtConnectionName: Friendly name of the connection to be used to refresh the range. If vtConn is 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

Declare Function HypRetrieveRange Lib "HsAddin" (ByVal vtSheetName As Variant, ByVal vtRange As Variant, ByVal vtConnName As Variant) As Long
Worksheets("Sheet2").Names.Add name:="MyRange", RefersTo:="=$E$11:$F$28"

Sub Sample_RetrieveRange
	Worksheets(Empty).Names.Add name:="MyRange", RefersT o:="=$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