Code: Select all
Dim spreadsheetService As Object
Dim daysInMonth As Integer
spreadsheetService = createUnoService("com.sun.star.sheet.FunctionAccess")
daysInMonth=spreadsheetService.callFunction("DAYSINMONTH", "2021-01-01")
Code: Select all
Dim spreadsheetService As Object
Dim daysInMonth As Integer
spreadsheetService = createUnoService("com.sun.star.sheet.FunctionAccess")
daysInMonth=spreadsheetService.callFunction("DAYSINMONTH", "2021-01-01")
Code: Select all
spreadsheetService = createUnoService("com.sun.star.sheet.FunctionAccess")
daysInMonth=spreadsheetService.callFunction("DAYSINMONTH", array("2021-01-01"))
print daysInMonth
FJCC wrote:The second argument of callFunction needs to be an array.Code: Select all
spreadsheetService = createUnoService("com.sun.star.sheet.FunctionAccess") daysInMonth=spreadsheetService.callFunction("DAYSINMONTH", array("2021-01-01")) print daysInMonth
Code: Select all
Sub showFormula()
inputbox "","", ThisComponent.CurrentSelection.getFormula()
End Sub
Code: Select all
daysInMonth=spreadsheetService.callFunction("com.sun.star.sheet.addin.DateFunctions.getDaysInMonth", array("2021-01-01"))