Programatically creating a XLS with a drop down cell in Python

pirhac picture pirhac · Aug 13, 2012 · Viewed 8.2k times · Source

I am currently creating XLS files programatically using Python and the XLWT/XLRD libraries.

I've been able to fill the cells with values and insert simple formulas. My challenge is that I want to create a drop down for my users (http://office.microsoft.com/en-us/excel-help/create-or-remove-a-drop-down-list-HP005202215.aspx)

Yes, I can easily do this in EXCEL, but I need to have this process automated - I'm using Python and the XLWT/XLRD libraries - I'd rather stick with them, but I'll switch to something else if necessary (I'm in a Ubuntu Linux Server).

Answer

k427h1c picture k427h1c · Feb 23, 2015

openpyxl also supports drop down cell in XLSX files via data validation: http://openpyxl.readthedocs.org/en/latest/validation.html