5

I have a document created by Excel 2007:

<fileVersion appName="xl" lastEdited="4" lowestEdited="4" rupBuild="4506" codeName="{B7FE6334-C1A2-E50D-BD3D-5F4D41BBC2E3}"/>

... which contains the following color in a font definition in xl/styles.xml:

<color indexed="81"/>

I understand from the ECMA standard that this colour index refers to the <indexedColors> collection in xl/styles.xml if there is such a collection, otherwise it refers to the default palette shown in the standard. My problem is that this document contains no <indexedColors> element, and the default palette only has 66 entries, so I do not know what 81 refers to. Does anybody else?

Interestingly a google search for color indexed="81" returns some sample OpenXML snippets containing the same thing, but alas no explanation.

Zero Piraeus
  • 56,143
  • 27
  • 150
  • 160
Shelest
  • 660
  • 8
  • 19
  • Anyways we can get the Excel worksheet? – jn1kk Feb 06 '13 at 16:27
  • @jsn,what do you mean? This is complete excel document but there is undocumented "81" color index. So what 81 means? After some experiments i noticed that if this color applied to cell - text will be white. but if it is applied to run in comment - text gonna be black. – Shelest Feb 07 '13 at 09:29
  • I messed up that sentence and only noticed when I could not edit anymore. Can we get the (physical) Excel worksheet? – jn1kk Feb 07 '13 at 14:34
  • 1
    From http://msdn.microsoft.com/en-us/library/office/cc296089%28v=office.12%29.aspx "Excel tries to randomly apply a color that corresponds to the argument value" for when it's outside of the valid range. My guess is index 81 is a system colour. Maybe you can try changing your foreground/background/other-system colours and see if index 81 gives a different colour (than the ones you stated). For example, the OpenXML/ECMA specs state that index 64 is a system foreground colour. But the actual RGB value will be different depending on the computer, right? – Vincent Tan Feb 10 '13 at 10:18
  • @VincentTan, you give a good direction, but I could not find any dependency between this 81 color and any other color in Windows, Excel or docoumet... Maybe you have some thoughts what exactly color i must change? – Shelest Feb 12 '13 at 11:28

3 Answers3

0

MSDN Documentation specifies the indexed property of class Color in OpenXML as:

Indexed color value. Only used for backwards compatibility. References a color in indexedColors.
The possible values for this attribute are defined by the W3C XML Schema unsignedInt datatype.

It is part of the larger DocumentFormat.OpenXml.Spreadsheet namespace.

The file you're describing was built via source code which contained the 81 value. It probably looked something like this Java code, defining a Color() instance with 81U from an unrelated color index.

If you're needing to find out why, I'd create an account at MSDN and reply to Jack9999's post with an inquiry as to why he used that value. I'm guessing it's a bug on his part, being familiar with a separate and possibly JAVA-related color index.

Excel--not recognizing it--is just using their default comment color values.

Cheers

obimod
  • 797
  • 10
  • 26
  • 1
    Although it is hard to believe all those google results are from a bug. Perhaps try to save the document as xml and see if it shows up as indexed="81" or if excel changes the value. – obimod Feb 14 '13 at 18:24
0

Index 0x51 is the system tooltip text color. (i.e. ::GetSysColor(COLOR_INFOTEXT) ).

ztef
  • 1
0

NECRO answer: From Vincent Tan's SpreadsheetOpenXmlFromScratch:

For colours, if you're dealing with the DocumentFormat.OpenXml.Color class, there are 3 ways of setting the colour value:

  • Indexed colour
  • RGB colour
  • Themed colour

There's a property called Auto of the Color class. I didn't find a use for it, and you can probably ignore it. Excel won't choke on errors if you don't set it in any case…

Indexed colours are for backwards compatibility, so I'm not going to teach you how. Basically it's an index value to the palette of colours stored within the spreadsheet's stylesheet. We'll deal with the Stylesheet class in the next chapter. You can explore the IndexedColors class on your own, which is a child class of the Colors class, which is in turn a child class of Stylesheet.

JimSnyder
  • 157
  • 1
  • 8