Read format or style of cells in Excel with Python

0

as with Python it is possible to detect, validate, read, compare or know the format or style of one or several cells in Excel, to be able to filter and / or discard by color.

    
asked by Luis Garcia 22.09.2018 в 06:14
source

1 answer

0

There is a library called xlwings , it may be useful for what you want to do. According to the documentation , to declare or get the color of a cell you can do the following:

>>> import xlwings as xw
>>> wb = xw.Book()
>>> xw.Range('A1').color = (255,255,255)
>>> xw.Range('A2').color
(255, 255, 255)
>>> xw.Range('A2').color = None
>>> xw.Range('A2').color is None
True

Currently xlwings is only compatible with Windows and OSX.

    
answered by 22.09.2018 / 07:52
source