Automatically refreshing a powerpivot-based model

menegocci

New Member
Joined
May 16, 2013
Messages
8
Hi,

I have a powerpivot-based model, and was looking through the web to automate the process of refreshing the graphs without having to open the powerpivot window, and then clicking on the "Refresh All" button (I'm using Excel 2010). I came across the VBA code written by Goban Saor on this blog: VBA Code to Automate a PowerPivot Refresh | Gobán Saor The problem is that I don't know enough about VBA to make the code provided on the website work with my spreadsheet, and I was wondering if anybody could help me. Which inputs in the code do I need to change to make it work with my specific file on Excel 2010 (if any)? The name of my Excel file is PTM.xlsm, and the name of the pivot table is Table1. Will the VBA code go on the Workbook script, or under the specific sheet? Since I have 5 sheets linked to the same underlying powerpivot, do I need to change anything in the code to account for that? Thank you for the help ahead of time!
 

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.
Hi,

I have a powerpivot-based model, and was looking through the web to automate the process of refreshing the graphs without having to open the powerpivot window, and then clicking on the "Refresh All" button (I'm using Excel 2010). I came across the VBA code written by Goban Saor on this blog: VBA Code to Automate a PowerPivot Refresh | Gobán Saor The problem is that I don't know enough about VBA to make the code provided on the website work with my spreadsheet, and I was wondering if anybody could help me. Which inputs in the code do I need to change to make it work with my specific file on Excel 2010 (if any)? The name of my Excel file is PTM.xlsm, and the name of the pivot table is Table1. Will the VBA code go on the Workbook script, or under the specific sheet? Since I have 5 sheets linked to the same underlying powerpivot, do I need to change anything in the code to account for that? Thank you for the help ahead of time!


Have you tried just recording your own macro? I saw the VBA code there in your link. The code is performing wayyyy more actions than you would want it to, potentially malicious since it goes to a website (....ww.w3.org/2001/XM...). and since you don't know much vba it is much better for practice that you attempt to make the code yourself rather than rely on a overly complex codes like that. This is just a quick warning before you put on that code.
 
Upvote 0
Hi marmellow,

It is not possible to simply record a macro to do that, since in Excel 2010, the PowerPivot tool is not accessible through simple VBA, hence why the code has to go through a couple of unusual routes to get it to work. From all of the responses on Saor's website, and other trustworthy sources, there is nothing malicious about the code, although there is a small chance that the code will render your spreadsheet unusable (a backup should solve this problem).
Thanks,
 
Upvote 0

Forum statistics

Threads
1,223,703
Messages
6,173,973
Members
452,540
Latest member
haasro02

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