|| | |||Browse by category|
Certain background and text colors display as black when loaded into Excel from an XLS file saved with Objective Grid Pro.
An Excel spreadsheet maintains a color palette of 56 colors. If a cell requests a color not in this palette, Excel displays that color as black. It does not attempt to 'get a nearest color'.
To avoid these 'black cells' in Excel, you should make sure the Excel color palette saved by Objective Grid Pro contains all the colors you are using in your grid. Objective Grid Pro defaults to a 'standard palette' of colors, which may or may not include all the colors in your grid. Objective Grid Pro does not try to automatically add colors to its Excel palette as it may overwrite some color you want available to your users. So, you have to explicitly set any specific colors you want available into this palette if they are not part of the default palette. To see the default palette colors, look at the COLORREF g_ref definition in the file Objective StudioSrcGridExcelgxextbl.cpp.
// Adding a custom color to OG's Excel color palette
// avoids the black color in Excel
CGXExcelColorTable* pColorTable = (CGXExcelColorTable*)
UINT nColorIndex = 32;
// Save custom color to spot 32 in palette