I have encountered an issue with conditional formatting when my PC's region and language settings are set to something other than English (specifically, French or Italian). When I create my spreadsheet and add a conditional format, in the <conditionalFormatting> section of sheet.xml, the <x:formula> field is storing the value with the CurrentCulture decimal separator (i.e. ',') instead of InvariantCulture (i.e. '.'). When the spreadsheet is opened by Excel I get an error saying Excel found unreadable content. If I click Yes to recover, I get the following message from the recovery report:
Removed Feature: Conditional formatting from /xl/worksheets/sheet.xml part
I have tried changing the CurrentCulture to "en" just before adding a conditional format (and restoring after) but then the <x:formula> field is stored as a string (although with the correct decimal separator) which gives undesired results in Excel.
Please Advise,
James Martin
Comments: This change did not fix the problem. Now, all the conditional formatting formulas have the correct decimal separator but are enclosed in "" which really confuses Excel (a lot of cells have conditional formatting applied that should not). This is the same result I had when I tried to change the CultureInfo before calling AddConditionalFormat(). Regards, Theon
Removed Feature: Conditional formatting from /xl/worksheets/sheet.xml part
I have tried changing the CurrentCulture to "en" just before adding a conditional format (and restoring after) but then the <x:formula> field is stored as a string (although with the correct decimal separator) which gives undesired results in Excel.
Please Advise,
James Martin
Comments: This change did not fix the problem. Now, all the conditional formatting formulas have the correct decimal separator but are enclosed in "" which really confuses Excel (a lot of cells have conditional formatting applied that should not). This is the same result I had when I tried to change the CultureInfo before calling AddConditionalFormat(). Regards, Theon