EssVSetStyle (sheetName, styleType, dimName, item, newValue) ByVal sheetName As Variant ByVal styleType As Variant ByVal dimName As Variant ByVal item As Long ByVal newValue As Variant
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 specifies the style setting you want to set.
dimName is the dimension name if styleType is 0; otherwise this parameter should be set to Null.
item is the style you want to set.
newValue contains the new setting of item.
Table 19 lists foreground and background colors.
Returns 0 if successful. A negative number indicates a local failure (see VBA Return Values). A return value greater than zero indicates a failure on the server.
Declare Function EssVSetStyle Lib "ESSEXCLN.XLL" (ByVal sheetName As Variant, ByVal styleType As Variant, ByVal dimName As Variant, ByVal item As Long, ByVal newValue As Variant) As Long Sub SetStyle() 'This sets the parent member style to italic X=EssVSetStyle("[Book2.xls]Sheet1",1,Empty,5,TRUE) 'This ensures the appropriate check box will be checked 'Note: If you want the Use Style check box to be checked, 'use the EssVSetSheetOption function Y=EssVSetStyle("[Book2.xls]Sheet1",1,Empty,1,TRUE) If X=0 And Y = 0 Then MsgBox("Set style successful.") Else MsgBox("Set style failed.") End If End Sub