473,289 Members | 1,896 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,289 software developers and data experts.

[xlwt] Changing Cell Background Color

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
0 3472

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: NeoPhreak | last post by:
I am creating a menu for my site and I would like it so that when the onMouseOut even is triggered it will cause the cell of the table to fade out back to the normal color with a delay. Can...
31
by: Arthur Shapiro | last post by:
I'm the webmaster for a recreational organization. As part of one page of the site, I have an HTML "Calendar at a Glance" of the organization's events for the month. It's a simple table of a...
13
by: mike | last post by:
I have some elements that I want to change color when I mouse over them and them back on mouse off. I'd like the color to remain with "#c7d0e0" when the user clicks on them. <td...
3
by: Peter Williams | last post by:
Hi All, I want to write some javascript for a html page which does the following. Imagine that the page contains a table with 2 columns and 3 rows, e.g.: +---+---+ | A | B | +---+---+
31
by: Greg Scharlemann | last post by:
Given some recent success on a simple form validation (mainly due to the kind folks in this forum), I've tried to tackle something a bit more difficult. I'm pulling data down from a database and...
1
by: printline | last post by:
Hi' I have a problem with changing the background color in a table cell when i click on the content in the cell. Here is my code: <script type="text/javascript"> var ie = document.all...
5
by: Albert-jan Roskam | last post by:
Hi, I wrote the program below to merge all xls files in a given directory into one multisheet xls file. It uses xlwt and xlrd. The xls files I use for input are generated by Spss. When I open and...
0
by: Albert-jan Roskam | last post by:
Hi John, Thanks! Using a higher xlrd version did the trick! Regarding your other remarks: -yep, input files with multiple sheets don't work yet. I kinda repressed that ;-) Spss outputs only...
2
by: nicstel | last post by:
Hello, I'm trying to find documentation about the xlwt (py_excelerator). I want to change the border of some cells. But the only types that I found is: double and dashed. How to do a simple line...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.