jmenche
06-16-2006, 12:04 PM
Howdy,
I have a workbook with a bunch of subs but some of the users get an error when the pivottables try to refresh. It works fine on mine and my assitant's computer. Turns out that we have 2003 and some other people in my office have 2002. I have about 9 tabs with pivots on them. The following sub fires each time a tab is activated. I only refresh the pivots on one sheet because I found out that all pivots will refresh if the source data is the same (it saves some time). The MySheets sub simply creates a new collection of sheet names and the protection subs loop through the collection and turn protection on/off so I don't think that they gum up the works.
Is this only a version problem? If so, is there a way to "fix" a 2002(XP) machine?
:beerchug:
Sub RefreshPivots()
'************************
'**Refreshes all pivots**
'**by updating 1 pivot **
'**for each data source**
'************************
Dim pt As PivotTable
Application.ScreenUpdating = False
Call MySheets
Call UnProtectAll
For Each pt In Sheets("JI").PivotTables
pt.RefreshTable
Next pt
Call ProtectAll
Application.ScreenUpdating = True
End Sub
I have a workbook with a bunch of subs but some of the users get an error when the pivottables try to refresh. It works fine on mine and my assitant's computer. Turns out that we have 2003 and some other people in my office have 2002. I have about 9 tabs with pivots on them. The following sub fires each time a tab is activated. I only refresh the pivots on one sheet because I found out that all pivots will refresh if the source data is the same (it saves some time). The MySheets sub simply creates a new collection of sheet names and the protection subs loop through the collection and turn protection on/off so I don't think that they gum up the works.
Is this only a version problem? If so, is there a way to "fix" a 2002(XP) machine?
:beerchug:
Sub RefreshPivots()
'************************
'**Refreshes all pivots**
'**by updating 1 pivot **
'**for each data source**
'************************
Dim pt As PivotTable
Application.ScreenUpdating = False
Call MySheets
Call UnProtectAll
For Each pt In Sheets("JI").PivotTables
pt.RefreshTable
Next pt
Call ProtectAll
Application.ScreenUpdating = True
End Sub