Libreoffice 无法填充列表框,因为我无法正确声明列表框

Libreoffice Unable to fill ListBox because I could not declare the listbox righteously

我的 Calc 工作表中有一个列表框,我正在尝试解决它以填充数据

    DialogLibraries.LoadLibrary("Standard")
    oDialog = CreateUnoDialog(DialogLibraries.Standard)

    listBoxGruppe = oEvent.Source.Context.getControl("Drop_Down_5") 'oDialog.getControl("Drop_Down_5")

    aItems = sheetb.getCellRangeByName(subStrRan).dataarray
    Dim sItems(ubound(aItems))
    For i = 0 To ubound(aItems)
        sItems(i) = aItems(i)(0)
     Next i
     
     listBoxGruppe.addItems(sItems, 0)

    oDialog.Execute()  

但是,您似乎需要调用某个对话框,但我不知道在这种情况下我的对话框的名称是什么 - 这就是我的代码背后的样子

我认为你在这种情况下不需要对话

dim RangeAddr as new com.sun.star.table.CellRangeAddress
    
    RangeAddr.EndColumn = 1
    RangeAddr.EndRow = Cell.CellAddress.Row
    RangeAddr.Sheet = 2
    RangeAddr.StartColumn = 1
    RangeAddr.StartRow = 0
    
    dim initParam(0) as new com.sun.star.beans.NamedValue
    initParam(0).Name="CellRange"
    initParam(0).Value = RangeAddr
    CellRangeListSource = doc.createInstanceWithArguments("com.sun.star.table.CellRangeListSource", initParam )
    listBoxGruppe.setListEntrySource CellRangeListSource