OpenXml Spreadsheet Fills

When creating an OpenXml Spreadsheet, the first two fills are reserved.

<fills count="2">
  <fill>
    <patternFill patternType="none"/>
  </fill>
  <fill>
    <patternFill patternType="gray125"/>
  </fill>
</fills>

If you create three custom fills, and do not include the “none” and “gray125” as the first two fills, Excel 2007 will ignore the first two fills and treat them as “none” and “gray125”.

It only took me about two and a half hours and playing with why my two custom styles were either coming out with a no background or a gray125 background before I added a third style and that one worked. I should have been clued in when documents saved by Excel 2007 always inserted the “none” and “gray125” fills.

One thought on “OpenXml Spreadsheet Fills

Leave a Reply

Your email address will not be published. Required fields are marked *