EssVGetStyle

Description

Retrieves the specified styles information.

Syntax

EssVGetStyle (sheetName, styleType, dimName, item)
ByVal sheetName As Variant
ByVal styleType As Variant
ByVal dimName As Variant
ByVal item As Long

Parameters

sheetName

sheetName is the text name of the worksheet to perform the action. sheetName is of the form "[Book.xls]Sheet". If sheetName is Null or Empty, the active worksheet is used.

styleType

styleType specifies the style setting you want to get.

Table 11. styleType Style Settings

styleTypeStyle Setting

0

Dimension

1

Child Members

2

Parent Members

3

Shared Members

4

Read Only

5

Read/Write

6

Contains Formula

7

Dynamic Calculations

8

Linked Objects

11

Attributes

12

Integration Server Drill-Through

dimName

dimName is the dimension name if styleType is 0; otherwise set this parameter to Null.

item

item is the style you want to get.

Table 12. Item Styles

ItemMeaningReturn Data Type

1

Use style

Boolean

2

Font name

Text

3

Font size

Number

4

Bold

Boolean

5

Italic

Boolean

6

Underline

Boolean

7

Strikeout

Boolean

8

Foreground color

Number

9

Background color

Number

10

Border

Boolean

Table 13 lists foreground and background colors.

Table 13. Foreground and Background Colors

IntegerColor

1

Black

2

White

3

Red

4

Lime

5

Blue

6

Yellow

7

Fuchsia

8

Aqua

9

Maroon

10

Green

11

Navy

12

Olive

13

Purple

14

Teal

15

Silver

16

Gray

Return Value

Returns text, number, or boolean indicating the state of the requested option. If an error occurs, #VALUE! is returned. If styleItem is not between 1 and 10, #NUM! is returned.

Example

This example gets the style for child members that is set to italic.

Declare Function EssVGetStyle Lib "ESSEXCLN.XLL" (ByVal sheetName As Variant, ByVal styleType As Variant, ByVal dimName As Variant, ByVal item As Long) As Variant

Sub GetStyle()
Dim X As String

X=EssVGetStyle("[Book2.xls]Sheet1", 1,Empty,5) 
If X="#NUM!" Then
MsgBox("Invalid item ID specified.")
Else
If X="#VALUE!" Then
MsgBox("Error. Option could not be found.")
Else
MsgBox("Get style is set to " + X)
End If

End If 
End Sub