title: when changing 2 report filters on a pivot table with vba excel crashes
body: <p>I've got a pivot table with 2 report filters I'm setting them to "Ashley" and 112 respectively.  The data table has both but not on the same line so the pivot table should return a blank or 0 for the sum of the data I want to retrieve.</p>
  
  <p>If I set these report filters in as stated above all goes well, but if I do it in vba excel crashes.</p>
  
  <p>here is my code</p>
  
  <p>.PivotTables("TtlGinShiftDT").PivotFields("Gin").ClearAllFilters
    .PivotTables("TtlGinShiftDT").PivotFields("Gin").CurrentPage = CStr(.Cells(NewPTData + 1, 3))
    .PivotTables("TtlGinShiftDT").PivotFields("Shift").ClearAllFilters
    .PivotTables("TtlGinShiftDT").PivotFields("Shift").CurrentPage = CStr(.Cells(NewPTData + 1, 1))</p>
  
  <p>Most of the time the 2 filters would have some valid data, but occasionally not, so it's been running fine up until today.</p>
  
  <p>As a work around I've put an if statement before I do line 4 in the code which references a countifs formula on the worksheet (using the filter values).</p>
  
  <p>This gets me by, but it seems like it shouldn't be so.  What am I doing wrong</p>
  
  <p>C-H
  office 2010</p>