Scheduling automated pivot table refresh

dotsent

Board Regular
Joined
Feb 28, 2016
Messages
85
Office Version
  1. 365
Platform
  1. Windows
Hi all!

I'm running Excel 2016 in Office 365 package (files not on OneDrive cloud as of now, should it matter). I operate 2 files - a template *.xlsm file where users do modifications and run VBA-s. Although they can enter data, the file is in read-only folder. The other is sort of a *.xlsm database file.

The template file has a simple pivot table which fetches data from a table in the database file. Haven't yet tried to, but even though in read-only folder, I believe the users can refresh the pivot table manually to fetch new data into the template file. As it is read-only, they obviously can't save the refreshed data.

Now this all is fine - however I would still want to have a process where the pivot table in this template is periodically refreshed AND SAVED. I'm thinking once a night.

I'm quite new to VBA and Excel Get & Transform functionalities - could you please advise me on what might be the reasonable way to do this? Is it that I can't bypass a server with write-rights to the designated folder which would then launching the template file at some X hour + run a macro (refresh pivot table + save + close workbook)?

While I have activated macro to be launched on file open, I don't think I can use this here as I don't want this macro to be launched when regular users open the file. Or is there a more elegant way to handle this? Or is VBScript the way to go which would open the Workbook and launch the proper macro externally?

Any feedback is greatly appreciated!

Thanks!
 
Last edited:

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
I believe the workbook would have to be open for the code to run, have you considered setting the pivot table to refresh on the file opening?

This can be achieved by selecting a cell in the pivot table and going to analyse ribbon>Options (Under PT Name) and selecting the Data tab. There is an option to refresh date when opening.
 
Upvote 0

Forum statistics

Threads
1,215,007
Messages
6,122,670
Members
449,091
Latest member
peppernaut

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