ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   2007 / 2003 Pivottable Macro (https://www.excelbanter.com/excel-discussion-misc-queries/237603-2007-2003-pivottable-macro.html)

jxbeeman

2007 / 2003 Pivottable Macro
 
Hi,
I'm trying to write a macro that creates a pivot table in 2007 that is
compatable with 2003. The reason is that i'm using 2007 and most everyone
else is still using 2003. below is the code from a macro record for creating
a pivottable.

ActiveWorkbook.PivotCaches.Create(SourceType:=xlDa tabase, SourceData:= _
"Sheet1!R2C1:R8C9", Version:=xlPivotTableVersion12).CreatePivotTable _
TableDestination:="Sheet4!R3C1", TableName:="PivotTable1",
DefaultVersion _
:=xlPivotTableVersion12

now i believe that i need to use Version10 instead of 12 inorder for it to
work in 2003. the problem is that when i run the macro it gives me an error.
Any Ideas.
Thanks,
Josh


All times are GMT +1. The time now is 09:49 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com