0

I propose to modify an excel 'template' file, which has charts and figures. At first I want to read one tab in that template as data frame. However, after I add a data frame in the target tab and then save as below, new file have no charts and figures even in other tabs.

book = load_workbook('template.xlsx')
writer = pd.ExcelWriter('template.xlsx',engine='openpyxl') 
writer.book = book
writer.sheets = dict((ws.title, ws) for ws in book.worksheets)

df_selection2.to_excel(writer,sheet_name='Selection',startrow=7, startcol=6,header=False, index=False)

writer.save()

Thoughts/Suggestions? Thanks!

stat0619
  • 45
  • 3
  • 9

0 Answers0