Hello,
An example of the python code is here:
#!/usr/bin/python3
#-*-coding:utf8-*-
import uno
    
class CalcExamples():
    def __init__(self):
        desktop=XSCRIPTCONTEXT.getDesktop()
        model=desktop.getCurrentComponent()
        if not hasattr(model, "Sheets"):
            model=desktop.loadComponentFromURL("private:factory/scalc", "_blank",
             0, ())
        sheets=model.Sheets.getByIndex(0)
        trange=sheets.getCellRangeByName("B2")
        trange.String="Experiência"
        #ComboBox
        celula1=sheets.getCellRangeByName("B4")
        celula2=sheets.getCellRangeByName("B5")
        celula3=sheets.getCellRangeByName("B6")
        celula1.setValue(2)
        celula2.setValue(3)
        celula3.setValue(5)
        combobox=sheets.getCellRangeByName("B7")
        oValidation = combobox.Validation
        oValidation.setFormula1("$Sheet1.$B$4:$B$6")
        combobox.Validation = oValidation
        return None
   
g_exportedScripts = CalcExamples,
The thing is I have to select the cell “B7” and go to Data → Validity → and on cell range click OK.
I don’t know what is missing to this for me!
This is on a Linux distro.
Thank’s
Thank’s it’s working.