问题
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 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)
来源:https://stackoverflow.com/questions/14554770/writing-to-existing-workbook