Writing to existing workbook

2019-07-25 16:48发布

I was wondering if someone could help me out with this. I want to make changes to an existing .xls file using xlwt/xlrd/xlutils. I took a look at this question and tried the two answers at the bottom of the page. When I tried the second answer, I got this error:

AttributeError: 'Sheet' object has no attribute 'cooked_page_break_preview_mag_factor'

When I tried the third answer, I got this error:

AttributeError: 'str' object has no attribute 'datemode'

The files I'm using are exactly the same as the ones in the answers with the exception of the filenames.

I appreciate any help. I would have commented on the answers but I don't have enough rep.

1条回答
可以哭但决不认输i
2楼-- · 2019-07-25 17:02

I had the same error and realised that I was copying the sheet instead of the workbook.

rb = open_workbook(file_path,formatting_info=True)
wb = copy(rb)
查看更多
登录 后发表回答