PDA

View Full Version : Excel Version problem??



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

Jacob Hilderbrand
06-18-2006, 01:22 PM
What is the actual error? Also if you can post the attachment I can test it in 2002.

Jan Karel Pieterse
06-19-2006, 01:28 AM
With Excel 2003, you cannot change protection settings (e.g. UserInterfaceOnly:=True) without supplying the protection password.

jmenche
06-19-2006, 07:41 AM
DRJ,

The 2002 users get a runtime error message "Method 'RefreshTable' of object 'PivotTable' failed.

The file that I have is 10mbs so posting an attachment is hard to do.