Using VBA to control pivot tables

EIMS

New Member
Joined
Sep 27, 2006
Messages
8
I have created pivot tables in Excel 2000 which do not work in Excel 2003 - I think Excel 2003 tries to refresh it too many times and says that it cannot open pivot table source file. Is there a way to use VBA to get around this probelm with Excel 2003? If so could someone tell me how to do it...
 

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December

Erdinç E. Karaçam

Board Regular
Joined
Sep 23, 2006
Messages
202
PivotTable's sheet's code page:

Code:
Private Sub Worksheet_Activate()
    Application.OnTime Now + TimeValue("00:00:05"), "RefreshPivotTable"
End Sub

And,

To Module1:

Code:
Sub RefreshPivotTable()
    Sheets("PivotTablePage").PivotTables("TheNameOfPivotTable").PivotCache.Refresh
End Sub

This sample refreshing the PivotTable every 5 seconds.

You can change the time set.
 

Forum statistics

Threads
1,136,427
Messages
5,675,784
Members
419,585
Latest member
popsin

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
Top