2007 / 2003 Pivottable Macro

J

jxbeeman

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:=xlDatabase, 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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top