Excel Automation using Python win32

anubhab89

New Member
Joined
Oct 4, 2020
Messages
1
Office Version
  1. 2016
Platform
  1. Windows
Dear Members,

I have a scenario where an excel workbook contains a data sheet and another sheet which has a pivot table derived from the data sheet.
Every month new data needs to be loaded into the data sheet (appended/freshly added) and the pivot tables refreshed.
So my idea was to read the existing excel structure to a pandas data frame, append the new information and dump it to the data sheet or write fresh information into the data sheet and then use pywin32 to refresh the pivot tables.
However, as soon as I modify the data sheet using pandas, the pivot table gets dismissed.
Request your kind suggestions and guidance based on your experience and expertise please.
 

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.
Why dont you use Power Query? Save the files down in a folder, then use Get Data from Folder. Do your data cleansing and then drop out in a table or, just drop out as a pivot tabe. No need to get fancy with the Python scripts. However, if you do want to explore Python and Excel have a look at the book Automate the Boring Stuff.
 
Upvote 0

Forum statistics

Threads
1,223,634
Messages
6,173,476
Members
452,516
Latest member
archcalx

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top