[]
        
(Showing Draft Content)

GrapeCity.Documents.Excel.Themes.Add

Add Method

Add(string, ITheme)

Creates a new custom theme based on the specified base theme.

If baseTheme is null, the new theme is created from the Office theme. If themeName is null or empty, a unique custom theme name is generated automatically.

@deprecated Use Theme(string, ITheme) instead.
Declaration
public ITheme Add(string themeName, ITheme baseTheme = null)
Public Function Add(themeName As String, Optional baseTheme As ITheme = Nothing) As ITheme
Parameters
Type Name Description
string themeName

The name of the new theme. If null or empty, a unique name is generated. If non-empty, it must not match a built-in or existing custom theme name ignoring case.

ITheme baseTheme

The theme to copy as the base for the new theme. If null, the Office theme is used.

Returns
Type Description
ITheme

The newly created ITheme.

Examples
Themes themes = new Themes();
ITheme baseTheme = Themes.Badge;
ITheme customTheme = themes.Add("Custom Badge", baseTheme);
workbook.Theme = customTheme;
Exceptions
Type Condition
ArgumentException

if themeName is non-empty and is not a valid theme name.