Hi,
Could anyone help me understand why the following sub fails:

Sub vcTransactionPivotSetup()
Dim rngToSet As Range, intRow As Integer, intColumn As Integer, intBlank As Integer
Dim ws As Worksheet, pt As PivotTable, pi As PivotItem
Dim pf As PivotField


Set ws = ThisWorkbook.Worksheets("Client View")
Set pt = ws.PivotTables("pvtTransactionData")
Set pf = pt.ColumnFields("Status")

'refresh table
pt.RefreshTable
'refresh pivot cache
pt.PivotCache.Refresh

For Each pi In pf.PivotItems
If pi.Value = "" Then
pi.Visible = False
Else
pi.Visible = True
End If
Next

'clean-up
Set ws = Nothing
Set pt = Nothing
Set pf = Nothing
End Sub

I am trying to hide the empty string entries and I'm getting a 1004 error "Unable to set the Visible property of the PivotItem class" in both Excel 2000 and Excel 2003. The sheet is unprotected, the pivot table doesn't store data.

Thank you