Bottom Page

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 Need to identify sheet color in excel workbook
#1
Hi all,

I have a given excel workbook that has multiple sheets. Some of these sheets have a colored background to them. Unfortunately, I am having trouble attaching a screenshot of this but I basically need to identify sheets that have a blue background.

I know that openpyxl and xlrd have the ability to load workbooks, get the sheet names and then loop through them. Does either of these modules have the ability to grab the sheet color or is there another library that can handle my intended scenario?

Below is some code I have been playing around with ..

# from openpyxl import load_workbook

# workbook = load_workbook(filename='TestRateFile.xlsx', read_only=True)
# sheets = workbook.sheetnames

# for s in sheets:
    # print(s)

import xlrd
loc = ('InXLS.xls')

wb = xlrd.open_workbook(loc, formatting_info=True)
sheets = wb.sheet_names()

for index, sh in enumerate(sheets):
    print(sh)

Below is the snippet I took of the workbook sheets

https://imgur.com/a/8Kdha8P
Quote
#2
only a guess, but named_styes? https://openpyxl.readthedocs.io/en/lates...med_styles
Quote
#3
Unfortunately, the named_styles approach did not work :(
Quote

Top Page

Possibly Related Threads...
Thread Author Replies Views Last Post
  Excel sheet by color abt_python 1 123 Jan-18-2020, 10:27 PM
Last Post: Clunk_Head
  Want to add formula to excel sheet nagu4651 1 206 Dec-26-2019, 10:13 PM
Last Post: keuninkske
  Need help to identify Mersenne Primes, I do need a search pattern. Pleiades 0 157 Dec-03-2019, 11:05 PM
Last Post: Pleiades
  help with changing values in an excel sheet and saving to a new file Moneyman212 2 236 Nov-19-2019, 06:25 AM
Last Post: Moneyman212
  Need to copy column of cell values from one workbook to another with openpyxl curranjohn46 3 1,096 Oct-12-2019, 10:57 PM
Last Post: curranjohn46
  Trying to color an excel row based on list curranjohn46 1 381 Oct-08-2019, 04:16 PM
Last Post: Aurthor_King_of_the_Brittons
  iterate read data from excel sheet jp2017 1 470 Jun-19-2019, 07:45 PM
Last Post: micseydel
  Does XLRD have a method to extract embedded objects (pdf) from an excel sheet? matthewme 1 455 Jun-13-2019, 10:00 PM
Last Post: Larz60+
  Syntax Error : I can't identify what's wrong! caarsonr 11 808 Jun-10-2019, 11:18 PM
Last Post: Yoriz
  Run macros of excel sheet from python scripts shubhamjainj 3 3,214 May-01-2019, 08:40 AM
Last Post: buran

Forum Jump:


Users browsing this thread: 1 Guest(s)