Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Programatically creating a XLS with a drop down cell in Python

Tags:

python

excel

xlwt

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).

like image 390
pirhac Avatar asked Aug 13 '12 15:08

pirhac


People also ask

Can Python manipulate Excel files?

The openpyxl module allows your Python programs to read and modify Excel spreadsheet files. For example, you might have the boring task of copying certain data from one spreadsheet and pasting it into another one.


1 Answers

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

like image 105
Karthic Raghupathi Avatar answered Nov 15 '22 00:11

Karthic Raghupathi