By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
464,388 Members | 1,179 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 464,388 IT Pros & Developers. It's quick & easy.

[xlwt] Changing Cell Background Color

P: n/a
I've posted this on the python-excel group, but perhaps people here
know what to do.

How does one change the cell background color using the xlwt module?
I've looked at several tutorials but none show how to change the
background color. I've tried the following:

badBG = xlwt.Pattern()
badBG.SOLID_PATTERN = 0x34
badBG.NO_PATTERN = 0x34
badBG.pattern_fore_colour = 0x34
badBG.pattern_back_colour = 0x34

badFontStyle = xlwt.XFStyle()
badFontStyle.Pattern = badBG

sheet1.write(1,1,'hello world', badFontStyle)

However, the background cell color still remains white. Any help
appreciated.
Jun 27 '08 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.