I have the following code:
workbook = openpyxl.load_workbook("C:/Users/Marina/Desktop/projects/jass/webscraping/list_following.xslx")
sheet = workbook['test']
for c in range(1,4):
sheet.cell(row = 1, column=c).value = "test"
workbook.save("list_following.xslx")
The following_list.xslx it’s in the same folder with the python file but when I run the program, I receive the following error:
openpyxl.utils.exceptions.InvalidFileException: openpyxl does not support .xslx file format, please check you can open it with Excel first. Supported formats are: .xlsx,.xlsm,.xltx,.xltm
I don’t understand why this error occurs. I can open my xslx file with Excel and I looked for the error online but didn’t found any clear explanation/information
I mention that I installed previously opnpyxl like that:
pip install openpyxl
I don’t know if it’s ok to install it like that or should I make some other configurations after this
3