This macro results in cell C5 “=rri(1,$A$1,$A$5)”.
However, #NAME? is displayed rather than the value.
Editing the cell, replacing any formula character with itself, converts the formula name to uppercase and displays the value.
The “AVERAGE” formula works fine. Why doesn’t the “RRI” formula work as expected?
Example spreadsheet with macro attached.
Macro RRI Formula.ods (11.6 KB)
Sub Main
ThisComponent.Sheets.getByName(“Sheet1”).getCellRangeByName(“C5”).setFormula("=RRI(1;$A$1;$A$5)")
ThisComponent.Sheets.getByName(“Sheet1”).getCellRangeByName(“A6”).setFormula("=AVERAGE($A$1:$A$5)")
End Sub
Version: 25.8.4.2 (X86_64)
Build ID: 290daaa01b999472f0c7a3890eb6a550fd74c6df
CPU threads: 8; OS: Windows 11 X86_64 (build 26200); UI render: Skia/Raster; VCL: win
Locale: en-US (en_US); UI: en-US
Calc: threaded
