Version

AddUserDefinedStyle(IWorksheetCellFormat,String) Method

Adds new user defined style to the workbook.
Syntax
'Declaration
 
Public Overloads Function AddUserDefinedStyle( _
   ByVal styleFormat As IWorksheetCellFormat, _
   ByVal name As String _
) As WorkbookStyle
public WorkbookStyle AddUserDefinedStyle( 
   IWorksheetCellFormat styleFormat,
   string name
)

Parameters

styleFormat
A cell format of the style.
name
The name which will identify the style in Microsoft Excel.

Return Value

The added user defined style as a WorkbookStyle instance.
Exceptions
ExceptionDescription
System.ArgumentNullExceptionname is null or empty.
System.ArgumentNullExceptionname is longer than 255 characters.
System.ArgumentExceptionA style already exists with the a name of name. Names are compared case-insensitively.
Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Server 2012, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also