Using 'openpyxl' engine to write in a Excel file - Handles Problem
I am having issue putting the writer.save()/writer.close() handles in the right place. I have tried it like this but this wont put the pivot tables to the excel sheet. what can i do to fix this?

```
import openpyxl
import pandas as pd
import numpy as np
from openpyxl.workbook import Workbook
wb = openpyxl.load_workbook("Test.xlsx")
wb.create_sheet("Results")
wb.create_sheet("sumPiv")

Results = wb.get_sheet_by_name('Results')
sumPiv = wb.get_sheet_by_name('sumPiv')

Results['A3'] = 'Weekly Average Spend'
Results['A4'] = 'Cost Per Trip'
Results['A5'] = 'Average Trips Per Week'
Results['A6'] = 'Total Spend'


wb.create_sheet('SQLPiv')
df3 = pd.read_excel("Test.xlsx","SQL")
SqlPiv = pd.pivot_table(df3,index = ['Ship_Date_Year' , 'Ship_Date_Weeknum'],
                           values = ['Customer_Amt_Excl_Fuel'],
                           aggfunc = ('sum'),
                           margins = True)
with pd.ExcelWriter('Test.xlsx', engine="openpyxl", mode="a") as writer: 
    SqlPiv.to_excel(writer, sheet_name="SQLPiv") 


df4 = pd.read_excel("Test.xlsx","SQL")
Costpiv = pd.pivot_table(df4,index = ['Ship_Date_Year'],
                           values = ['Customer_Amt_Excl_Fuel'],
                           aggfunc = ('sum'),
                           margins = True)

with pd.ExcelWriter('Test.xlsx', engine="openpyxl", mode="a") as writer: 
    Costpiv.to_excel(writer, sheet_name="sumPiv")
    
writer.save()
writer.close()
    
    
wb.save('Test.xlsx')
print(wb.get_sheet_names())
print("DONE")


```