I'm having trouble running formulas in an excel 2007 spreadsheet based on data written to the spreadsheet from a C# .NET 3.5 program. I check the number format and it is set to number. However, my formula using the data in these cells says it's 0. Here's how I'm writing the data to the spreadsheet:
Range range = objSheet.get_Range("A1", "Z" + iRow.ToString());
range.set_Value(Missing.Value, fields);
range.get_Range("A1", "Z" + iRow.ToString()).NumberFormat = "0.00";
where iRow is the last row in the range. Here is a formula that takes two cells written to from the program:
=SUM(U4,U5)
The result of this is 0. The values in U4 & U5 are 128.25 and 128.25. Their number formats are both "0.00". Why can I add U4 and U5 to get the right sum?
Bookmarks