-1

After read and write an excel file using python modules xlrd and xlwt, my excel file is corrupted. I faced following prompt while opening using excel 2016. But, the file is opening perfectly in google sheets...

The error excel 2016 throwing is

"Can't open file beacuse the file format or file extension is not valid"

enter image description here

CypherX
  • 7,019
  • 3
  • 25
  • 37

1 Answers1

0

As I mentioned in my above comment, the xlwt package (https://pypi.org/project/xlwt/) is only capable of writing to xls format.

Either change the extension of your file and try it, or change your code to save it as xls format.

I can't see your code but imagine it would look something like this:

wb.save('example.xlsx')

when it should be

wb.save('example.xls')
Derek Eden
  • 4,403
  • 3
  • 18
  • 31