ladyfafa
ladyfafa

Reputation: 7269

how to write into XLS with python with format unchanged?

Is there a way to write something into an XLS file with python while keeping the initial format of this XLS file unchanged (such as font size, cell background color, etc)Thanks!

Upvotes: 2

Views: 837

Answers (4)

Steven Rumbalski
Steven Rumbalski

Reputation: 45542

If the available tools like xlrd, xlwt, and xlutils don't work, you may have to fall back to programmatically editing the file with Excel via COM. Of course, you'll need a copy of Excel, have to work from Windows, and it will be slower than other approaches.

Upvotes: 0

Fábio Diniz
Fábio Diniz

Reputation: 10353

You could also use pywin32 if you are using Windows

Upvotes: 0

Manuel Salvadores
Manuel Salvadores

Reputation: 16525

If you can go for XML serializations of Office documents. Also have a look at ... http://www.python-excel.org/

Upvotes: 0

juanchopanza
juanchopanza

Reputation: 227418

Maybe have a look at xlrd, xlwt, xlutils:

http://www.python-excel.org/

I have found it pretty useful in the past.

Upvotes: 2

Related Questions