HypSetOption

Data Source types: Essbase

Description

HypSetOption() enables you to set Smart View options as both default and sheet specific so you do not need separate VBAs for the two types of options.

Syntax

HypSetOption (vtItem,vtOption,vtSheetName)

ByVal vtItem As Variant

ByVal vtOption As Variant

ByVal vtSheetName As Variant

Parameters

vtItem: The index/constant to refer to a particular option See Table 18, Options Constants for HypGetOption and HypSetOption for a list of constants.

vtOption: Tne input value to set for an option

vtSheetName: The sheet name to set a sheet level option. If not provided, then the default option is use.

Return Value

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

Example

Public Declare Function HypSetOption Lib "HsAddin" ( ByVal vtItem As Variant,ByVal vtOption As Variant, ByVal vtSheetName As Variant) As Long

Sub setOption()

sts = HypSetOption(HSV_ZOOMIN, 2, "Sheet2") ") ‘set zoom in option for sheet2
sts = HypSetOption(HSV_ZOOMIN, 1, "") ‘set default zoom in

sts = HypSetOption(HSV_INVALID_LABEL, "#InvalidTest", "Sheet2")  ‘set invalid label for sheet2
sts = HypSetOption(17, "#globalinvalid", "") ‘set default invalid label, numbers can be used instead of declared constants
End Sub