I want to open an .xlsm file with openpyxl library. When I tried to open it, it gives me the IndexError: index out of range. I also observed if I delete all the hidden worksheets in the file before running the code it will be OK. Can you help me? Because I don't want to modify all the files with this problem
I tried to modify read_only and keep_vba to True but doesn't work.
Openpyxl does not support .xlsm files, one option is to use
win32com.clientif you have Excel installed. To save you some time you will need topip install pywin32in order to access this library.Here is an example of opening a file.