Skip to content

Using Themes

EPPlus ⅚ support creating and loading themes - this is done via the Workbook.ThemeManager. A theme can be exported from Excel using the thmx format and then loaded via EPPLus:

var thmxFile = new FileInfo("c:\\temp\\integral.thmx");
package.Workbook.ThemeManager.Load(thmxFile);
Dim thmxFile = New FileInfo("c:\temp\integral.thmx")
package.Workbook.ThemeManager.Load(thmxFile)

The theme can then be altered via the ThemeManager.CurrentTheme property

//Change the color of the Accent1 theme color.
package.Workbook.ThemeManager.CurrentTheme.ColorScheme.Accent1.SetRgbColor(Color.FromArgb(32, 78, 224));
'Change the color of the Accent1 theme color.
package.Workbook.ThemeManager.CurrentTheme.ColorScheme.Accent1.SetRgbColor(Color.FromArgb(32, 78, 224))

See also