I was trying to open xlsx file using openpyxl version 3.10. Here's my code:
path = (r'C:\Users\karol\OneDrive\Pulpit\OASIS\*.xlsx')
list_of_files = glob.glob(path)
latest_file = max(list_of_files, key=os.path.getctime)
excel = openpyxl.load_workbook(latest_file)
I got TypeError: expected <class 'openpyxl.worksheet.cell_range.MultiCellRange'>
because of conditional formatting.
I did some digging and found this: Can't load workbook with openpyxl: during handling of the above exception, another exception occurred So, I downgraded openpyxl to version 2.4.11 and now I get ValueError: {0} is not a valid coordinate or range ... but I did not specify any coordinates or range? I'm confused, just want to open xlsx file HELP