I am trying to convert a string to a double and set the value in MS Excel.
I have tried the following methods of converting:
double d = Convert.ToDouble(value);
cell.PutValue(value);
style.Number = 2; //Decimal to the hundreths
cell.SetStyle(style);
and,
cell.PutValue(value.ToString(), true);
however, when the data loads in Excel I get the error message that ‘the number is formatted as text’
image.png (3.6 KB)
even though when I select the properties of the cell it shows it has been formatted correctly.
image.png (17.6 KB)
Are you aware of what could cause this and how to have Excel recognize the value appropriately?
I have also tried to convert the value to a Fraction and Currency and get the exact same results.