Posted 5 April 2018, 5:40 am EST
I get an exception when this line of code tries to put a formula in a cell
ws[row, colIndex].Formula = “IF(R[-1]C <> "", R[-1]C - SUM(R[2]C:R[100]C), "–")”;
I have tried typing the same formula directly in the spreadsheet and it also does not work with relative references, but it does work with A1 style references. As far as I can tell these relative references are correct as specified in the help file.
Here is the stack trace:
at BuildWorksheet() in C:\Projects\Test\Test\ViewModels\WSViewModel.cs:line 350GrapeCity.CalcEngine.CalcParseException: Invalid cell reference or name.
Error offset:3
at GrapeCity.CalcEngine.CalcParser.b(CalcParserContext A_0, String A_1, Int32 A_2)
at GrapeCity.CalcEngine.CalcParser.d(CalcParserContext A_0, b A_1)
at GrapeCity.CalcEngine.CalcParser.a(CalcParserContext A_0, List
1 A_1) at GrapeCity.CalcEngine.CalcParser.b(CalcParserContext A_0, List
1 A_1)at GrapeCity.CalcEngine.CalcParser.c(CalcParserContext A_0, b A_1)
at GrapeCity.CalcEngine.CalcParser.d(CalcParserContext A_0, b A_1)
at GrapeCity.CalcEngine.CalcParser.a(CalcParserContext A_0, List
1 A_1) at GrapeCity.CalcEngine.CalcParser.b(CalcParserContext A_0, List
1 A_1)at GrapeCity.CalcEngine.CalcParser.Parse(String text, CalcParserContext context)
at GrapeCity.CalcEngine.CalcCalculationManager.a(CalcLocalIdentity A_0, String A_1, Boolean A_2)
at GrapeCity.CalcEngine.CalcCalculationManager.SetFormula(CalcCellIdentity id, String formula, Boolean isArrayFormula)
at GrapeCity.Windows.SpreadSheet.Data.c.c(CalcCalculationManager A_0, CalcLocalIdentity A_1, String A_2, Boolean A_3)
at GrapeCity.Windows.SpreadSheet.Data.Worksheet.l(Int32 A_0, Int32 A_1, Int32 A_2, Int32 A_3, SheetArea A_4, String A_5, Boolean A_6, Boolean A_7)
at GrapeCity.Windows.SpreadSheet.Data.Cell.set_Formula(String value)