1

我的 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()  

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

4

1 回答 1

1

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

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
于 2021-06-09T07:32:32.010 回答