| | |
Excel sheet background color
Thread Solved |
•
•
Join Date: Feb 2008
Posts: 198
Reputation:
Solved Threads: 0
Hi All,
I am using the following code to write data into an excel sheet:
I am able to change the default sheet name to "Report". I want to change the color of the excel sheet from WHITE to YELLOW. How can I do it?...
Any help is much appreciated.
Regards,
Dinil
I am using the following code to write data into an excel sheet:
Python Syntax (Toggle Plain Text)
# Open the Output Spreadsheet objExcel = win32com.client.Dispatch("Excel.Application") # Creating object to write to Spreadsheet self.xlApp =Dispatch("Excel.Application") # Creating Workbook self.Wkbk = self.xlApp.Workbooks.Add() # Get sheet count intShtCnt=self.Wkbk.Worksheets.Count # Creating worksheets wsObjReport = self.Wkbk.Worksheets.Add() # Setting names to the sheets wsObjReport.Name="Report" # Alignment Variables xlLeft, xlRight, xlCenter = -4131, -4152, -4108 # Loop to remove extra sheets(created by default) for intiLoopIndex in range(1,intShtCnt+1): self.Wkbk.Worksheets("Sheet"+str(intiLoopIndex)).Delete() # Setting active sheet sheets = self.Wkbk.Sheets sheets("Report").Activate()
I am able to change the default sheet name to "Report". I want to change the color of the excel sheet from WHITE to YELLOW. How can I do it?...
Any help is much appreciated.
Regards,
Dinil
I am not sure whether you can change the entire sheet color to yellow.
But you can change the colors of individual cells to any color u want.
here 6 is for yellow.
http://www.geocities.com/davemcritchie/excel/colors.htm
you can use the above URL for other color indexes.
But you can change the colors of individual cells to any color u want.
•
•
•
•
worksheet.Cells(row,column).interior.colorindex = 6
http://www.geocities.com/davemcritchie/excel/colors.htm
you can use the above URL for other color indexes.
Last edited by xav.vijay; Jun 29th, 2009 at 7:24 pm.
![]() |
Similar Threads
- PHP code for uploading Excel sheet (PHP)
- Insert Background Image in Excel Sheet (Visual Basic 4 / 5 / 6)
- Retriving data from excel sheet into an asp page (ASP)
- iframe background color - pls help (HTML and CSS)
- Open Excel Sheet in Vb.net (VB.NET)
- VS 2005 ListViews not holding background color (C#)
- help with setting background color!!! (Java)
Other Threads in the Python Forum
- Previous Thread: How to open PDF file
- Next Thread: python socket tcp/ip program for sending text line from client to server
| Thread Tools | Search this Thread |
abrupt alarm ansi anti approximation assignment avogadro backend beginner binary bluetooth calculator character cmd code customdialog cx-freeze data decimals dictionaries dictionary directory dynamic error examples exe file float format function gnu graphics gui halp heads homework http ideas import input java launcher leftmouse line linux list lists loop module mouse number numbers output parsing path pointer port prime programming progressbar projects push py2exe pygame pyglet pyqt python random recursion schedule screensaverloopinactive script scrolledtext sqlite statistics string strings sudokusolver sum table terminal text thread threading time tlapse tricks tuple tutorial twoup ubuntu unicode urllib urllib2 variable ventrilo wikipedia write wxpython xlib





