https://bugs.documentfoundation.org/show_bug.cgi?id=150253
Bug ID: 150253
Summary: XCell::setFormula() for AddIn functions works only
with programmatic name
Product: LibreOffice
Version: Inherited From OOo
Hardware: All
OS: All
Status: UNCONFIRMED
Severity: normal
Priority: medium
Component: Calc
Assignee: [email protected]
Reporter: [email protected]
This macro leads to #NAME? error because the EDATE name is not recognized as it
is implemented as an AddIn function and the formula API for XCell::setFormula()
for AddIns handles only the PODF programmatic names due to legacy reasons:
> Sub Main
> row=3
> ThisComponent.Sheets.getByIndex(0).getCellByPosition(3,row-1).setFormula("=EDATE($B"&(row)&";$C"&(row)&")")
> End Sub
Using the programmatic name com.sun.star.sheet.addin.Analysis.getEdate instead
of EDATE works and yields the expected working =EDATE($B3;$C3) formula:
> Sub Main
> row=3
> ThisComponent.Sheets.getByIndex(0).getCellByPosition(3,row-1).setFormula("=com.sun.star.sheet.addin.Analysis.getEdate($B"&(row)&";$C"&(row)&")")
> End Sub
See also
https://ask.libreoffice.org/t/macro-edate-in-setformula-goes-lowercase/76996
https://ask.libreoffice.org/t/macro-edate-in-setformula-goes-lowercase/76996/14
--
You are receiving this mail because:
You are the assignee for the bug.