This project has moved and is read-only. For the latest updates, please go here.

Cannot use styles from Ribbon bar

Apr 4, 2011 at 3:36 PM

Hey folks,

I'm trying to use the style "Accent2" from the Ribbon Bar in Excel 2007 in my worksheet but I notice that it isn't in the list of Named Styles available to the Workbook, only "Normal" seems to be there.  Am I missing something?  Is there a way to address these or should I just create my own style in the program to emulate the style from the workbook?  Here's the code snippet I am using:

worksheet.Cells["A1:R1"].StyleName = "Accent2";


Apr 4, 2011 at 9:45 PM

There are no predefined named styles in EPPlus. "Normal" is the default value of the StyleName property. Have a look at Sample6 under the comment "//Add a HyperLink to the statistics sheet." to get a hint of how you can create your own named styles.

Apr 4, 2011 at 11:51 PM

Gotcha thanks.  I found my way around it by defining a table and using the TableStyles as in one of the examples.