Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Group Method failed in macro
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("Q uantity Supplied") .Orientation = xlDataField .Caption = "Shipped Quantity" .Position = 2 .NumberFormat = "#,##0.00" .Function = xlSum End With With ActiveSheet.PivotTables(sTablename).PivotFields("S hip 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("Y ears") .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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Macro does not work after the program has been restarted in excel.Run time error 2147417848 (80010108) Method visible of object_worksheet failed | Excel Programming | |||
Activate method of OLEObject failed | Excel Programming | |||
Copypicture method failed | Excel Programming | |||
Calculation Method Failed | Excel Programming | |||
Method ~ of Object ~ Failed. | Excel Programming |