Reputation: 1
I have a formula in my sheet that is: =texte(maintenant();"hh:mm:ss")
that works fine to display the time, but when I use google script to add the formula like this: range33.setFormula("=texte(maintenant();\"hh:mm:ss\")");
it show #NOM?
unrecognized function "texte"
and the formula is the same words for words... Is there a setings somewhere? I just dont understand!
Upvotes: 0
Views: 75
Reputation: 1
Solved! I just put the formula in english within the scripteditor wich is set to english and it automatically translate it to french in my sheet and it works now!
Upvotes: 0
Reputation: 27400
Issues:
Use template literals to construct the formula string
texte
and maintenant
are locale words for text
and now
therefore use text
and now
instead otherwise the formulas won't be translated properly in the sheet and it will show an error.
Solution:
range33.setFormula(`text(now();"hh:mm:ss")`)
Upvotes: 1