Forum Discussion
StB-Germany
Aug 25, 2023Copper Contributor
Formulas do not calculate after using Office Script
Dear community, I have problem which I cannot get my head around. I have to convert a Excel table into a specific format and use some formulas to enter information I need for the further proc...
- Aug 25, 2023
setValue into C5 puts the value, which is string, into that cell. You shall to set the formula, like
workbook .getActiveWorksheet() .getRange("C5") .setFormula("=CONCATENATE(B5,A5")
StB-Germany
Aug 25, 2023Copper Contributor
Maybe I was not specific enough.
Of course you are right that changing the formatting after entering formula does nothing. Therefore I change the formatting first and only then enter the formula.
This works as intended. If have included this sequence in the script. My limited insight led me to the conclusion that if I do 1. formatting and 2. enter the formula will result in the calculation of the formula.
Performing this sequence manually always leads to the desired result. Using a script and I only see the formula and not the result.
SergeiBaklan
Aug 25, 2023Diamond Contributor
setValue into C5 puts the value, which is string, into that cell. You shall to set the formula, like
workbook
.getActiveWorksheet()
.getRange("C5")
.setFormula("=CONCATENATE(B5,A5")