This might be going right over my head.
I am using this block:
writer = pd.ExcelWriter(
filepath, engine="openpyxl", mode="a", if_sheet_exists="replace"
)
df.to_excel(writer, "MySheetName", index=False)
writer.save()
to overwrite an existing Excel sheet with a pandas dataframe.
This is not overwriting the sheet 'MySheetName' and is instead creating a new sheet called 'MySheetName1'.
What am I missing here?