[Python] How to fill a ComboBox (in Libre Office Calc) with a python script?

Discussão em 'Python' iniciado por Stack, Junho 27, 2025.

  1. Stack

    Stack Membro Participativo

    I work on a Calc file, with several tabs. Some are used to store datas (like SQL tables).

    With a python macro, I want to fill a ComboBox "Classes" using the datas in one of these tables.

    [​IMG]

    My code :

    bas = CreateScriptService('SFDocuments.Document')
    formulaire = bas.Forms(F_sheetName, 'Formulaire')
    comboBoxClasses = formulaire.Controls(O_classes)


    I'd like to be able to do something like this :

    comboBoxClasses.addItem("class1")
    comboBoxClasses.addItem("class2")


    The function addItem does not exist. What should I use instead ?

    Continue reading...

Compartilhe esta Página