title: PivotItem changed to Visible = True, but pivot table not updating accordingly
body: <p>as title says. both the column fields and row fields must proceed by a month for each monthly updated version.</p>
  
  <pre><code>Sub SetDatesforAllPvt()
  
  Application.ScreenUpdating = False
  
  Dim i, j, k As Integer
  Dim ipvt As PivotTable
  Dim isheet As Worksheet
  Dim cutoffdate As Date
  
  cutoffdate = DateSerial(ActiveWorkbook.Sheets("Slicers New").Range("E4").Value - 3, ActiveWorkbook.Sheets("Slicers New").Range("E7").Value + 1, 1)
  
  
  'For i = 1 To ActiveWorkbook.Sheets.Count
   '   Set isheet = ActiveWorkbook.Sheets(i)
   Set isheet = ActiveSheet
  
      For j = 1 To isheet.PivotTables.Count
      Set ipvt = isheet.PivotTables(j)
      'ipvt.PivotCache.MissingItemsLimit = xlMissingItemsNone
      'ipvt.RefreshTable
  
      With ipvt.PivotFields("IncurredM")
          .Orientation = xlRowField
          .Position = 1
          .ShowAllItems = True
          For k = 1 To .PivotItems.Count
              If .PivotItems(k) &gt;= cutoffdate Then
                  .PivotItems(k).Visible = True
              Else
                  .PivotItems(k).Visible = False
              End If
          Next
         ' .Orientation = xlhiddenfield
        '  .Orientation = xlRowField
  
  
      End With
      With ipvt.PivotFields("Paid M")
          .Orientation = xlColumnField
          .Position = 1
          .ShowAllItems = True
          For k = 1 To .PivotItems.Count
              If .PivotItems(k) &gt;= cutoffdate Then
                  .PivotItems(k).Visible = True
              Else
                  .PivotItems(k).Visible = False
              End If
          Next
       '   .Orientation = xlhiddenfield
        '  .Orientation = xlColumnField
  
      End With
  
      Next
  'Next
  
  End Sub
  </code></pre>
  
  <p>For some reason, after running the above, when individuela fields are opened in Excel, the newest month has a check mark next to it, so it should be visible. However, the month is not included in both the column and row. I have to manually deselect, then select the month, then the pivot table updates correctly and displays the latest month. What am I doing wrong?</p>
  
  <p>adding the refreshtable or pivotcache.refresh did not help either.</p>
  
  <p>Additionally, there are about 40-50 tables all interconnected with different slicers. There are about 20 slicers. When this script is run through the many worksheets, this code takes an unbelievably long time (I haven't seen the end of completion yet). At the bottom of Excel, it says running slicer something. Any advice on this matter would also be very appreciated.</p>
  
  <p>Thank you</p>