openpyxl
openpyxl copied to clipboard
Read xlsx file contains ole objects and save it make xlsx file corrupted or ole objects missing
from openpyxl.reader.excel import load_workbook
xlsx_fp = r"D:\xslx_with_ole.xlsx"
out_fp = r"D:\xslx_with_ole_processed.xlsx"
wb = load_workbook(xlsx_fp, keep_vba=True) # cause corrupted file
wb = load_workbook(xlsx_fp) # cause ole missing
wb.save(out_fp)