I have a workbook called "Pivot Template.xlsx". I have data from a query in a Pandas dataframe called "results". I need to put this data on a tab called "Pivot Data". I am using the code below for writing to the file, but the problem is that deletes all of the existing tabs when writing the file.
writer = pandas.ExcelWriter('Pivot Template.xlsx', engine='xlsxwriter')
results.to_excel(writer, sheet_name='Pivot Data', index=False, encoding='utf8')
writer.save()
I would like to get this working with just Pandas or openpyxl. As one other catch, I have several other tabs that have pivot tables based off of this tab and I would like them to work after doing this write.