Home > other >  Openpyxl XLSX file open error
Openpyxl XLSX file open error

Time:04-16

Openpyxl. Utils. Exceptions. InvalidFileException: openpyxl does not support. XLSX 'file format, both please check you can open it with Excel first. The Supported formats are: the XLSX,. XLSM, the XLT
This mistake how to solve the

CodePudding user response:

May be a file format error, using excel to open, in addition to try

CodePudding user response:

1. Take a look at whether the EXCEL is already open,
2. Openpyxl 3.0.6 can open office2013 form,
 
The class MyExcel () :
Wb #=None workbook
Ws=None # worksheet
Cur_index=2
Def __init__ (self, path) :
The self. The file_path=path
Try:
The self. The wb=openpyxl. Load_workbook (path)
Self. Ws=self. Wb. Active
Except:
Print (' open the excel file failed. \ n ')

CodePudding user response:

Another possibility is that the system hides the file suffix, and manually add the suffix, cause the file name into a. XLSX. XLSX,
It is also unable to open,
  • Related