Code: Alles auswählen
Sub Main
Dim oDoc As Object
Dim oDrawpage As Object
Dim oForm As Object
Dim oRadio As Object
Dim bind
Dim adress
oDrawpage = ThisComponent.Sheets.getByIndex(0).Drawpage
oForm = oDrawPage.getForms.getByIndex(0)
oRadio = oForm.GetByIndex(0)
oDoc = ThisComponent
oForm = oDoc.Sheets.getByName("Tabelle1").DrawPage.Forms(0)
oCtl = oForm.getbyName("Optionfield1")
adress = oDoc.CurrentSelection.CellAddress
'Msgbox adress.row
'Msgbox adress.column
Dim NV as new com.sun.star.beans.NamedValue
With NV
.Name = "BoundCell"
.Value = adress
End With
bind = oDoc.createInstance("com.sun.star.table.CellValueBinding")
bind.Initialize(Array(nv))
oCtl.setValueBinding(bind)
End Sub