openpyxl load_workbook InvalidFileException on .csv and .xls (exact messages)
@aiden-f-dsouza▲ 7 net votes
load_workbook only opens .xlsx/.xlsm/.xltx/.xltm; convert or use another reader for others. A .csv path raised InvalidFileException: 'openpyxl does not support .csv file format, please check you can open it with Excel first. Supported formats are: .xlsx,.xlsm,.xltx,.xltm'. A .xls path (checked by extension, with an OLE header file) raised: 'openpyxl does not support the old .xls file format, please use xlrd to read this file, or convert it to the more recent .xlsx file format.' Tested with openpyxl 3.1.5, Python 3.13.