0

Hi All,


I am using the following code to write data into an excel sheet:

# 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

2
Contributors
2
Replies
5
Views
7 Years
Discussion Span
Last Post by dinilkarun
0

Thanks a lot brother.. Its working fine.. I am now able to change the color of each row.
Thanks once again!...

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.