Hi,
UseExcelStandardColorPalette is indeed only used for exporting, because it should be not needed for importing.
When exporting: xls file format only allows a palette of 56 colors, so we need to convert whatever colors you are using to those 56 colors. If UseExcelStandardColorPalette = true, we will just map those colors to Excel's standard palette If UseExcelStandardColorPalette = false, we will create a palette that matches the colors you are exporting more closely, and use that palette in the file.
When importing: We just read which of the 56 indexed colors you are using, and use that in the grid. There is no need to adapt any palette.
The most likely thing here is that the file doesn't use the actual 56 colors, but more. When Excel introduced xlsx in 2007, it moved colors from indexed to "true color", and it saves the color twice in the xls file: Once in the xls format, as an indexed color, and again in xlsx file format, as a true color. Old applications which don't understand xlsx (like say Excel 2003 or FlexCel 3, which is what AdvGridExcelIO uses) will keep reading the old color and showing that, but newer apps (like FlexCel 7 or newer Excels) will discard that indexed color value and use the "true color" value stored as xlsx inside the xls file.
If you can send me a xls file with the issue, I can confirm if that is the problem by opening in Excel 2003. It should show the same as the DataGrid.
I blogged about the color difference years ago: TMS Software | Blog
If you save the file in the second screenshot as xls, it will show in Excel 2003 (or FlexCel 3) as the first screenshot. Even when Excel 2007 will be able to read that xls file and show the true colors. This is just because inside the xls file Excel 2007 will save huge amounts of repeated information in the xlsx file format, which old xls readers can't read. Newer engines like FlexCel 7 can read both the xls and xlsx parts inside the file and show it correctly. Sadly to do so it requires a lot more of code (FlexCel 7 is more than a million lines of code, most of it is to deal with all the little issues in xlsx), and we can't ship an embedded FlexCel 7 to power AdvGridExcelIO (like we can with FlexCel 3)
You can check if those colors are the ones you are seeing in the datagrid. If they aren't, as said, please send me the xls file to adrian@tmssoftware.com and we will take a look.
Sorry, I forgot this was fnc when I searched for the link (even if it is in the title!) Anyway, glad you could solve it. Indeed, there is a vcl and a fnc version.