Err:504 when using setFormula function

I ran into a problem with setting a formula through macro. Issue is that at the very end Calc is setting four brackets “))))” instead of three. Spits out Err:504.

The function as it is passed to setFormula is as follows:

“=IF(EXACT(C” & rowEdited & “;”""");"""";CONCAT(LEFT(F" & rowEdited & “;LEN(F” & rowEdited & “)-7; “” “”; E” & rowEdited & “;”" “”; G" & rowEdited & “; “” “”; TEXT(C” & rowEdited & “;”“000000"”);"" “”;RIGHT(F" & rowEdited & “;6)))”

Thank you in advance for any suggestions.

Hello,

Appears you are missing a right bracket in the section:

CONCAT(LEFT(F" & rowEdited & “;LEN(F” & rowEdited & “)-7;

which is why one is being added to the end.

Of course, right after the 7!! Such a silly mistake. Thank you and my sincere apologies. Truly embarassing.

You are most welcome. No apologies necessary.

1 Like