This mistake how to solve the
CodePudding user response:
May be a file format error, using excel to open, in addition to tryCodePudding 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,