python openpyxl load_workbook,修改excel单元格内容后保存,再打开Excel提示“部分内容有问题。是否让我们尽量尝试恢复?”
from openpyxl import load_workbook
workbook_tarfile = load_workbook(targetfile)
sheets_tarfile = workbook_tarfile.sheetnames
booksheet_tarfile_1 = workbook_tarfile[sheets_tarfile[0]]
booksheet_tarfile_1['A1'] = ‘hello’
workbook_tarfile.save(targetfile)