I'm sending a number to Excel 2007 as a string (Cell.Value := '2,5') using late binding. The actual code is more like:
var CellVal: OLEVariant;
...
CellVal := FloatToStr(2.5); // Regionally formatted.
Cell.Value := CellVal;
On my Excel 97 version, this value will be formatted as "General" by default and will be seen as a number. A customer with Excel 2007 ends up with the cell formatted as "Standard" and Excel appears to see it as a string (it's not right aligned.) Note that I am using the regional settings to format the number and that Excel appears to be using the default regional settings as well.
If the customer just types 2,5 into a cell it accepts it as a number and if he does a copy of the string '2,5' from the clipboard into a cell, it also gets accepted as a number. Does anyone know why the string value sent though the automation interface to Excel ends up as a non-number?
Thanks for any suggestions! Edited to specify the regional decimal separator for the customer is ','.