Referencing How to write to an existing excel file without overwriting data? I tried the below code:
book = load_workbook('output.xlsx')
writer = pd.ExcelWriter('output.xlsx')
writer.book = book
writer.sheets = dict((ws.title, ws) for ws in book.worksheets)
Output.to_excel('output.xlsx', "Main", index=True, header=False, startcol = pickupcol)
writer.save()
This is part of a loop, but I found that to_excel could only write 256 columns at one time, so I decided to use a variable pickupcol
so I could just add one section at a time. Unfortunately it deletes the previous data with blank cells.
Thoughts/Suggestions? Thanks!