Hey,

I'm trying to set the visibility of the PIvotItems in a for a particular
PivotField. I keep getting the following error:
"Run Time Error: 1004. Unable to set the visible property of the PivotItem
class."

Here's my code (just the loop I'm having trouble with):
'Select only the current week to display
PF.AutoSort xlManual, "Week Ending"
For Each PI In PF.PivotItems
If PI.Name <= DateAdd("ww", -1, Date) Then
PI.Visible = False
End If
Next PI
'End Select only the current week to display

Basically, I have pivot table with data for each week of the current year
and my goal is to display the most recent week which in this case would be
the current date minus 1 week.

Any help would be greatly appreciated!

--
-ridawg