'Export python list to already open workbook
I have a code that generates a python list and I intend to store the results to excel workbook that is already open. I tried this approach but this works only for closed workbooks
df = pd.DataFrame(results)
writer = pd.ExcelWriter('Sample.xlsx', engine='xlsxwriter')
df.to_excel(writer, sheet_name='Sheet1', index=False)
writer.save()
Another point, is it possible to deal with xlsm files?
I tried the append approach like that
with pd.ExcelWriter("Sample.xlsx", mode="a", engine="openpyxl") as writer:
df.to_excel(writer, sheet_name="Sheet1")
But still couldn't work on the open workbook. It works only for the closed workbook.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
