0

I am getting the above error when trying to create a new workbook with the following commands:

import xlwt
workbook = xlwt.Workbook()
workbook.save(‘my_file.xls’)

I am new to Python and following a guide but I can’t find what this error means

1
  • can you able to add your error's stack trace by editing your question, so that it will be helpful for other newbie. Commented Mar 15, 2018 at 13:07

1 Answer 1

1

This works for me. I think your workbook needs to be setup with a sheet to be valid.

import xlwt
workbook = xlwt.Workbook()
workbook.add_sheet("Sheet")
workbook.save("myfile.xlsm")
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.