ExcelMapper icon indicating copy to clipboard operation
ExcelMapper copied to clipboard

set header background color using code

Open emkoos opened this issue 3 years ago • 1 comments

Hi. Is it possible to create styles for header using code when creating a file?

I found a solution using the event to set the AutoSizeColumns, but with the colors it doesn't work anymore, because the Save function overwrites them.

emkoos avatar Apr 22 '22 10:04 emkoos

The invocation of the Saving event happens right before the workbook is written so I'm surprised the style gets overwritten: https://github.com/mganss/ExcelMapper/blob/efc3efdf2de04a4776c58f17fa21b8009074645c/ExcelMapper/ExcelMapper.cs#L1012-L1014

Have you already investigated where the overwriting occurs?

mganss avatar Apr 22 '22 14:04 mganss