3

How I can set the cell fill to transparent using xlwings? I understand that xl.range(XX).color = (r,g,b) can be used to set the color, but is there a specific command for no fill? I would still like to see the cell boundaries.

Kev
  • 118,037
  • 53
  • 300
  • 385
Caleb Pearson
  • 105
  • 1
  • 4

1 Answers1

0

If you set color to None, the background colour of your range will be transparent.

import xlwings as xw

# Connect to the Excel file
wb = xw.Book(EXCEL_FILENAME)
sht = wb.sheets[EXCEL_SHEETNAME]
sht.range('A1:C10').color = None
Romain Capron
  • 1,565
  • 1
  • 18
  • 23