Dear all,

I have an Excel Workbook which contains 2 sheets. Each sheet has a pivot
table and the pivot tables on both pages are generated by the same macro
program. Below is part of the codes:

:
:
:
With ActiveSheet.PivotTables(sTablename).PivotFields("Quantity Supplied")
.Orientation = xlDataField
.Caption = "Shipped Quantity"
.Position = 2
.NumberFormat = "#,##0.00"
.Function = xlSum
End With
With ActiveSheet.PivotTables(sTablename).PivotFields("Ship Balance")
.Orientation = xlDataField
.Caption = "Shipment Balance"
.NumberFormat = "#,##0.00"
.Function = xlSum
End With

Range("E3").Select
Selection.Group Start:=True, End:=True, Periods:=Array(False, False,
False, _
False, True, True, True)
Range("E3").Select
With ActiveSheet.PivotTables(sTablename).PivotFields("Years")
.Orientation = xlPageField
.Position = 2
End With
:
:
:

Each pivot tables carries different data range from the same data source.
The pivot table in sheet1 can be generated successfully, but it fails in
sheet2.

The debugger stops at "Selection.Group Start:=True, End:=True,
Periods:=Array(False, False, False, False, True, True, True)" and the error
message is "Group Method of Range class failed".

The problem exists since last week and it has never happened before. I
suspect that it is a problem of data instead of the program. Anyone has an
idea?
Thanks a million!

Ivan