title: Deselect one item with VBA in a pivottable that is added to the data model
body: <p>This is my first time posting here and I am new to VBA. </p>
  
  <p>As mentioned in the title I want to deselect one item for multiple (in this example two) filters of multiple pivottables (which are all in one sheet) which are added to the data model. The data of the pivottable is added to the data model so the values can be set to distinct counts (which is not possible without adding the data to the data model). </p>
  
  <p>The reason I want to deselect one item is actually a workaround for what I really want. I add data to the source data (dynamic named range) and refresh the pivottables. But, because there are filters applied to the pivottable the newly added items will not be selected automatically. So, you might think why not use the option "Include new items in manual filter"? Well, because the data of the pivottable is added to the data model this option is grayed out (so it cannot be selected). </p>
  
  <p>Therefore, I am trying to write some code to first select all the items (so the newly added items are added to the manual filter) and then deselect the items I do not want (because I know beforehand which items to deselect as they are already in the first set of data). </p>
  
  <p>I have tried to use the macro recorded, but apparently when items in the manual filter are deselected it records the selected items which remains.</p>
  
  <p>Because the data of the pivottable is added to the data model the code is written differently. The solutions I found, where only applicable for "regular" pivottables. </p>
  
  <p>Find below the code I tried to use. As mentioned in the code the first part works, only the second part does not. Also I have no idea if the property "HiddenItemsList" is the correct one to use. </p>
  
  <pre><code>    Sub DataModel_PivotTable_FilterFields()
  
      'works - will select all the items in the manual filter
          Worksheets("xxx").PivotTables("PivotTable3").PivotFields( _
              "[xyx].[xxy].[xxy]").VisibleItemsList = Array("")
  
      'does not work - should deselect the item "zxx" after this part works I will add the other item 
      'to be deselected in the array if possible
          Worksheets("xxx").PivotTables("PivotTable3").PivotFields( _
              "[xyx].[xxy].[xxy]").HiddenItemsList = Array( _
              "[xyx].[xxy].&amp;[zxx]")
  
      End Sub
  </code></pre>
  
  <p>Could someone please try to help me with this? It would be very much appreciated.</p>