Code: Alles auswählen
aRangeProperty(0).Value = oRange.RangeAdress
Moderator: Moderatoren
Code: Alles auswählen
aRangeProperty(0).Value = oRange.RangeAdress
Code: Alles auswählen
oRange.RangeAddress
Code: Alles auswählen
REM ***** BASIC *****
Option Explicit
Sub Staerke_Change(oEvent)
dim oAuslesen, oDocument, oSheet, oDraw, oForm, oControler as Object
dim oListe, oListBox as Object
dim oListBoxNr as Integer
dim aRangeProperty(0) as new com.sun.star.beans.NamedValue
dim oRange, oListSource
oAuslesen = oEvent.Source.Model.Name
oDocument = StarDesktop.CurrentComponent
oSheet = oDocument.Sheets.GetByName("Bestellformular")
oDraw = oSheet.DrawPage
oForm = oDraw.Forms.GetByIndex(0)
oControler = oDocument.GetCurrentController
oListBox = oControler.GetControl(oForm.GetByName(oAuslesen))
oListBoxNr = Val(Right(oForm.getByName(oAuslesen).Name,2))
Select case oListBox.SelectedItemPos
Case 0 : oRange = oDocument.Sheets.GetByName("HILFSTABELLE").GetCellRangeByName("$A$2")
Case 1 : oRange = oDocument.Sheets.GetByName("HILFSTABELLE").GetCellRangeByName("$A$2:$A$26")
Case 2 : oRange = oDocument.Sheets.GetByName("HILFSTABELLE").GetCellRangeByName("$B$2:$B$55")
Case 3 : oRange = oDocument.Sheets.GetByName("HILFSTABELLE").GetCellRangeByName("$C$2:$C$70")
Case 4 : oRange = oDocument.Sheets.GetByName("HILFSTABELLE").GetCellRangeByName("$D$2:$D$45")
End Select
aRangeProperty(0).Name = "CellRange"
aRangeProperty(0).Value = oRange.RangeAddress
oListSource = oDocument.CreateInstanceWithArguments("com.sun.star.table.CellRangeListSource",aRangeProperty)
oListe = oForm.GetByName("List Box " & oListBoxNr + 7)
oListe.ListSourceType = com.sun.star.form.ListSourceType.TABLEFIELDS
oListe.ListEntrySource = oListSource
End Sub