title: how to set PivotField.HiddenItemsList property's value if CubeField.Orientation = xlPageField
body: <p>The task is to automate OLAP pivot table data filtering. There are some items in pivot field named sPivotFieldName I need to exclude. The code below works pretty fine.</p>
  
  <pre><code>With Worksheets(sWorksheetName).PivotTables(sPivotTableName)
      With .CubeFields(sCubeFieldName)
          .Orientation = xlRowField
          .IncludeNewItemsInFilter = True
      End With
      .PivotFields(sPivotFieldName).HiddenItemsList = vSomeItemsToExclude
  End With
  </code></pre>
  
  <p>But the problem appears when I'm trying to change cube field ".Orientation" property's value to xlPageField. Run-time error 1004 fires each time. Here's an example:</p>
  
  <pre><code>With Worksheets(sWorksheetName).PivotTables(sPivotTableName)
      With .CubeFields(sCubeFieldName)
          .Orientation = xlPageField
          .IncludeNewItemsInFilter = True
      End With
      .PivotFields(sPivotFieldName).HiddenItemsList = vSomeItemsToExclude
  End With
  </code></pre>
  
  <p>The reason seems to be that items of the fields placed in pagefield aren's visible as they are when placed for example in the rowfield (one can see them as row captions). Or maybe there's something else. What am I missing?</p>