« first day (2605 days earlier)      last day (760 days later) » 

6:12 PM
with pd.ExcelWriter(r"C:\Users\CarlosGomez\Documents\Proyectos\Python\SICO\Tablero de indicadores Cartera CJL-VF.xlsx",engine="openpyxl", mode="a",if_sheet_exists="replace",data_only=True) as writer:

workBook = writer.book
try:
workBook.remove(workBook['BD FT'])
except:
print("Worksheet does not exist")
finally:
dfReporteFCTtot.to_excel(writer, sheet_name='BD FT',index=False)
writer.save()
print("Reporte de flujo de caja teorico procesado!")
 
6:29 PM
workBook = writer.book
like that?
 
alright
with pd.ExcelWriter(filePath,engine="openpyxl", mode="a",if_sheet_exists="replace",data_only=True) as writer:

workBook = writer.book
try:
workBook.remove(workBook['BD FT'])
except:
print("Worksheet does not exist")
finally:
dfReporteFCTtot.to_excel(writer, sheet_name='BD FT',index=False)
writer.save()
print("Reporte de flujo de caja teorico procesado!")
im having problems with openpyxl, when i try to save data in a sheet it gets deleted and the file turns corrupted
 
You got the code markdown right, but you lost all indentation in the process. Which was kind of why I asked for the proper formatting.
 
oof
 

« first day (2605 days earlier)      last day (760 days later) »