I have a workbook with a series of 50 or so worksheets each with a pivot table created from the same pivot cache to display an analysis of sales of different products.

On one worksheet I have created a group field to further analyse one particular product.

When this field was first created it was created on every sheet and was visible. I had to go through each sheet and manually hide it.

My issue is that when new products need to be added to the group doing so makes the field on every other sheet visible again. I have been trying to write a short VBA macro this morning to go through each of the other sheets to set the orientation to hidden and have failed miserably.

My code so far is:
Sub SuppressStock_No2()
'
' SuppressStock_No2 Macro
'
Dim pt As PivotTable
Dim ws As Worksheet

For Each ws In ActiveWorkbook.Worksheets
For Each pt In ws.PivotTables
pt.PivotFields("Stock_NO2").Orientation = xlHidden
Next pt
Next ws

End Sub[/SIZE]

When I run this I get a Run-time error 1004 saying "Unable to get the PivotFields property of the PivotTable class".

Can somebody help me please with a suitable piece of code. I always have difficulty with this sort of routine and don't really understand the error message.