title: VBA change Slicer item selection
body: <p>I´m a newbie with VBA and need to learn how to change automatically the selected values on a Slicer.
  I first tried with a very simple one, but I tried every variation possible to the following code and always get an error 1004, this time "application-defined or object-defined error"</p>
  
  <pre><code>Sub SlicerSelect()
      With ActiveWorkbook.SlicerCaches("Slicer_Time")
          .SlicerItems("2016").Selected = False
      End With
  End Sub
  </code></pre>
  
  <p>Does someone have an idea ? <a href="https://i.stack.imgur.com/uhqRQ.png" rel="nofollow noreferrer">Here</a> is also an image of my slicer and its settings.</p>
  
  <p>By the way, it works when I'm using the .ClearManualFilter command.</p>
  
  <p>Thanks a lot !</p>
  
  <p>Here is also a macro record by filtering manually my items :</p>
  
  <pre><code>Sub Macro2()
  ' Macro2 Macro
  ActiveWorkbook.SlicerCaches("Slicer_Time2").VisibleSlicerItemsList = Array( _
      "[Booking Period].[Time].[YEAR].&amp;[2018]")
  End Sub
  </code></pre>