A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » Worksheet Functions
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

excel 2007 macro recorded pivot table



 
 
Thread Tools Display Modes
  #1  
Old April 16th, 2010, 01:33 PM posted to microsoft.public.excel.worksheet.functions
Getting Old
external usenet poster
 
Posts: 2
Default excel 2007 macro recorded pivot table

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?
  #2  
Old April 16th, 2010, 10:09 PM posted to microsoft.public.excel.worksheet.functions
ker_01
external usenet poster
 
Posts: 87
Default excel 2007 macro recorded pivot table

Actually, it is fairly common for a recorded macro to not work "out of the
box"- they often need just a tiny bit of tweaking.

I'm not a big pivot-table automator, and without seeing the rest of the
macro, it is hard to tell what the problem might be- the wrong sheet might be
active, etc.

I'd suggest you post a followup to the Excel.programming newsgroup, and
include all (or at least a larger chunk) of the code that preceeds the line
where it errors out.

HTH,
Keith

"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?

  #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?

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 10:54 AM.


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