Set formula on cell range (using api)

I need to use the linest() function throug the .net api . The function return a matrix and I can’t use the setFormula of cell object. In LibreOffice I select 4 cells, I write the formula and I press Ctrl+Shift+Enter to confirm. How can I do the same throug the API?

Stefano

Hi - Define ArrayFormula for the range. For example:

oSheet = thiscomponent.sheets.getByIndex(0)
oRange = oSheet.getCellRangeByName("B1:B5")
oRange.setArrayFormula("=ROW(A1:A5)")

Regards