I have an excel file with 2 sheets, one is a dashboard kind with styles the other is a sheet with data. I've tried to load both like this
xls = pd.ExcelFile('template.xlsx')
dash = pd.read_excel(xls, 'Dashboard')
db = pd.read_excel(xls, 'db')
writer = pd.ExcelWriter('report.xlsx', engine="xlsxwriter")
dash.to_excel(witer, sheet_name='Dashboard', index=False)
df.to_excel(writer, sheet_name='db', index=False) # previous constructed dataframe
writer.save()
It works in the sense that formulas are preserved and such, but the styling vanishes. Is there a way to do this and preserve the styling?
EDIT:
D Stanley suggested that this [1][https://stackoverflow.com/questions/55229090/why-pandas-dataframe-style-lost-when-saved-with-to-excel] could answer but I'm trying to use a template as there are way to many formatting and styling to be done