If your code changes part of the Pivot Table, then the PivotTableUpdate event will be in a loop. You need to disable events before you manipulate the pivot table.

Application.EnableEvents = False
On Error Resume Next
' manipulate the pivot table
Application.EnableEvents = True
On Error GoTo 0