Can’t figure out what is wrong with the code, All I get is 0… If I make and undo anything in the formula after it is set, it then works correctly. It should display “Total Cost: …” instead all i get is 0.
I also tried getcellbyposition(1,0).formula = … and copying it from a range with working formulas with same result.
sCurrencyFormat = "[$$-409]#,##0.00;[RED]-[$$-409]#,##0.00"
aNew = oSheet.getCellRangeByPosition(0,0,iCols,iRows).FormulaArray
aNew(0)(1) = "=CONCATENATE(""Total Cost: "";TEXT(SUBTOTAL(9;B2:B65535);""" & sCurrencyFormat & """))"
oSheet.getCellRangeByPosition(0,0,iCols,iRows).FormulaArray = aNew