Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 67
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro does not work after the program has been restarted in excel.Run time error 2147417848 (80010108) Method visible of object_worksheet failed [email protected] Excel Programming 7 August 24th 05 03:11 PM
Activate method of OLEObject failed jose luis Excel Programming 0 June 3rd 05 04:55 AM
Copypicture method failed Kamal[_5_] Excel Programming 2 April 22nd 04 11:31 AM
Calculation Method Failed Martiin Excel Programming 2 December 1st 03 01:37 PM
Method ~ of Object ~ Failed. Joan Excel Programming 5 August 26th 03 08:13 PM


All times are GMT +1. The time now is 04:31 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"