title: Grouping by year in pivot vba
body: <p>I'm trying to create a pivot table in vba with a field that groups dates by month/year; the Date field runs successfully, but when I add the code to group it by month/year, it gives me an "object required error". How should I fix this? </p>
  
  <pre><code>With ActiveSheet.PivotTables("APivotTable").PivotFields("Date")
  .Orientation = xlColumnField
  'Error is here
  .LabelRange.Group Start:=True, End:=True, _
  Periods:=Array(False, False, False, False, True, False, True)
  .Position = 1
  End With
  </code></pre>