View Single Post
  #3  
Old April 19th, 2010, 09:06 AM posted to microsoft.public.excel.worksheet.functions
Roger Govier[_8_]
external usenet poster
 
Posts: 338
Default excel 2007 macro recorded pivot table

Hi

The problem is
xlPivotTableVersion12

For XL2003 change to
xlPivotTableVersion11

--
Regards
Roger Govier

getting old wrote:
I record a macro in excel 2007 in which i create a pivot table. when i try to
run the macro i get "invalid procedure call or argument". the same process
works fine in excel 2003. If i look at the debug window the "problem code" is
: -ActiveWorkbook.PivotCaches.Create(SourceType:=xlDa tabase, SourceData:= _
"JDE Import!R1C1:R3500C37",
Version:=xlPivotTableVersion12).CreatePivotTable _
TableDestination:="Calculations & summary!R4C3",
TableName:="PivotTable7", _
DefaultVersion:=xlPivotTableVersion12

I guess this gives two questions: how can a recorded macro then not work
again? (i have cleared, removed and recreated the destination sheet and all
sorts) and two, what is wrong with the macro itself?