ich habe mir vorgenommen eine calc Tabellendokument mit einen Formular zu entwerfen, dass diese Tabellen mit Werten füttert. Ich habe dazu zwei Fragen.
1. Wie kann ich die Werte aus den Formularfeldern auslesen, die dann eingetragen werden sollen?
2. Wie kann ich die Zellen, in die die Werte kommen sollen so ansprechen, dass immer die nächste leere Zeile verwendet wird.
Bisher habe ich folgenden Code entwickelt (Bitte nicht lachen, ich bin blutige Anfängerin

Private Sub OKButton_Click()
Dim art As String
DIM dat As Long
DIM hab As String
DIM sol As String
DIM beschr As String
DIM oDocument as Object, oSheet as Object, oCell as Object, oComboBox as Object
art = oComboBoxArt
dat = oDateFieldDatum
hab = oTextBoxHaben
sol = oTextBoxSoll
oDocument=ThisComponent
If art = ("Betriebskosten") Then
oSheet=oDocument.Sheets.getByName("Betriebskosten")
oCell=oSheet.getCellByPosition(0, 1)
oCell.Value = dat
oCell=oSheet.getCellByPosition(1, 1)
oCell.Value = hab
oCell=oSheet.getCellByPosition(2, 1)
oCell.Value = sol
oCell=oSheet.getCellByPosition(3, 1)
oCell.Value = beschr
Elseif art = ("Autokosten") Then
oSheet=oDocument.Sheets.getByName("Autokosten")
oCell=oSheet.getCellByPosition(0, 1)
oCell.Value = dat
oCell=oSheet.getCellByPosition(1, 1)
oCell.Value = hab
oCell=oSheet.getCellByPosition(2, 1)
oCell.Value = sol
oCell=oSheet.getCellByPosition(3, 1)
oCell.Value = beschr
Elseif art = ("Mietkosten") Then
oSheet=oDocument.Sheets.getByName("Mietkosten")
oCell=oSheet.getCellByPosition(0, 1)
oCell.Value = dat
oCell=oSheet.getCellByPosition(1, 1)
oCell.Value = hab
oCell=oSheet.getCellByPosition(2, 1)
oCell.Value = sol
oCell=oSheet.getCellByPosition(3, 1)
oCell.Value = beschr
Elseif art = ("Durchlaufende") Then
oSheet=oDocument.Sheets.getByName("Durchlaufende")
oCell=oSheet.getCellByPosition(0, 1)
oCell.Value = dat
oCell=oSheet.getCellByPosition(1, 1)
oCell.Value = hab
oCell=oSheet.getCellByPosition(2, 1)
oCell.Value = sol
oCell=oSheet.getCellByPosition(3, 1)
oCell.Value = beschr
Elseif art = ("Einnahmen") Then
oSheet=oDocument.Sheets.getByName("Einnahmnen")
oCell=oSheet.getCellByPosition(0, 1)
oCell.Value = dat
oCell=oSheet.getCellByPosition(1, 1)
oCell.Value = hab
oCell=oSheet.getCellByPosition(2, 1)
oCell.Value = sol
oCell=oSheet.getCellByPosition(3, 1)
oCell.Value = beschr
Elseif art = ("Kassenbuch") Then
oSheet=oDocument.Sheets.getByName("Kassenbuch")
oCell=oSheet.getCellByPosition(0, 1)
oCell.Value = dat
oCell=oSheet.getCellByPosition(1, 1)
oCell.Value = hab
oCell=oSheet.getCellByPosition(2, 1)
oCell.Value = sol
oCell=oSheet.getCellByPosition(3, 1)
oCell.Value = beschr
else
oSheet=oDocument.Sheets.getByName("Betriebskosten")
oCell=oSheet.getCellByPosition(0, 1)
oCell.Value = dat
oCell=oSheet.getCellByPosition(1, 1)
oCell.Value = hab
oCell=oSheet.getCellByPosition(2, 1)
oCell.Value = sol
oCell=oSheet.getCellByPosition(3, 1)
oCell.Value = beschr
End If
End Sub
Dieser Code trägt mir immerhin Werte (leider nur Nullen) in das sheet "Betriebskosten" ein. Die anderen elseif Bedingungen sind nicht testbar, da ich ja die Werte nicht aus den Boxen rauskriege. Zudem habe ich bisher auch nur rausbekommen wie ich die Zellen über die Position ansprechen kann, also nicht relativ.
Ich sitze seit zwei Tagen mit verschiedenen Dokumentationen dran kriegs aber nicht hin (Ich kann kein "Variable nicht belegt" mehr sehn

Danke
Bianca