Openpyxl: unexpected fail with CellIsRule function
问题 I am opening an Excel file and applying some conditional formatting: from openpyxl import * from openpyxl.formatting.rule import CellIsRule os.chdir(r'C:\Users\myfolder') wb= load_workbook('myfile.xlsx') ws = wb.active #Conditional formatting ws.conditional_formatting.add('S3:S89', formatting.CellIsRule(operator='equal', formula=['1'], font='#FF0000')) #Red This was done based on this answer. However, I get this error: AttributeError Traceback (most recent call last) <ipython-input-190