I’ve written a VB macro using the “set formula” for a rather complex formula and LO would not calculate the formula. I spent an hour looking for an error in my formula but the formula was correct. I finally got “set formula” to work by changing the separators from commas to semicolons 
code snippet that fails to compute:
formula = “=TRIM(RIGHT(B”+fRow+",LEN(B"+fRow+")_
-(FIND("+""""+","+""""+",B"+fRow+")+1)))"+"&"+""""+_
" “+”"""+"&TRIM(LEFT(B"+fRow+",FIND("+""""+","+""""+",B"+fRow+")-1))"
wSheet.getCellByPosition(2,wsRow).setFormula(formula)
code snippet that executes as expected:
formula = “=TRIM(RIGHT(B”+fRow+";LEN(B"+fRow+")_
-(FIND("+""""+","+""""+";B"+fRow+")+1)))"+"&"+""""+_
" “+”"""+"&TRIM(LEFT(B"+fRow+";FIND("+""""+","+""""+";B"+fRow+")-1))"
wSheet.getCellByPosition(2,wsRow).setFormula(formula)