Hi,

I've written some VBA code which manipulates a pivot table for the purposes of populating a generated report (via code later in the macro). The code runs without error on my computer, but runs into "Error 1004 unable to set the visible property of the pivotitem class" on all 3 other computers I've tried to run this on.

Here is the code it gets tripped up on (specifically when setting the Visible property in my pivot table):

With Sheets("TD Pivot").PivotTables("PivotTable1").PivotFields("Month Committed")
    Dim pvtitem
    For Each pvtitem In .PivotItems
        If pvtitem <= EndDate Then
            pvtitem.Visible = True
        Else
            pvtitem.Visible = False
        End If
    Next
End With

-There are no file location specific references in my code
-Excel versions are exactly the same (14.0.6123.5001)
-No add-ins in VBA or Excel installed on my or other computer
-There are no external references
-I have also tried modifying the code to recreate all pivot tables each time the macro runs, to no avail

I have run out of ideas. Has anyone else run into an issue like this?