Get Started
Documentation

SetThemeColors

SetThemeColors(oThemesColors)

Set the theme colors to the current spreadsheet.

Parameters:

Name Type Description
oThemesColors ThemesColors | string The list of theme colors that will be used to select the color scheme to be set to the current spreadsheet.

Example

Copy code
builder.CreateFile("xlsx");
var oWorksheet = Api.GetActiveSheet();
var themes = Api.GetThemesColors();
for (var i = 0; i < themes.length; ++i) {
oWorksheet.GetRange('A' + (i + 1)).SetValue(themes[i]);
}
Api.SetThemeColors(themes[3]);
builder.SaveFile("xlsx", "SetThemeColors.xlsx");
builder.CloseFile();

Resulting document