In OpenOffice funziona, in Libreoffice no.
Codice: Seleziona tutto
Sub CampoData()
' ESEMPIO 1
Dim Doc AS Object
Dim Sheet As Object
Dim DrawPage As Object
Dim Form As Object
Dim Ctl As Object
Dim oCell
Doc = StarDesktop.CurrentComponent
Sheet = Doc.Sheets.GetByIndex(0)
DrawPage = Sheet.DrawPage
Form = DrawPage.Forms.GetByIndex(0)
Ctl = Form.getByName("Campodata1") 'Campo data (Controllo del formulario)
ActiveCell=ThisComponent.CurrentSelection
ActiveCell.value = CDateFromIso(Ctl.Date)
ActiveCell.NumberFormat=75
ActiveCell=thisComponent.currentSelection.CellAddress
col=ActiveCell.column
row=ActiveCell.row
oRanges = Sheet.getCellByPosition(col, row + 1)
Doc.CurrentController.Select(oRanges)
End Sub
Codice: Seleziona tutto
ActiveCell.value = CDateFromIso(Ctl.Date)