I have a routine that creates a pivot chart and functions perfectly on my installation of Office 2010, however when opened and used by someone with Office 2007 the routine bombs while creating the pivot chart. The code in question is shown below:
If I change the portion Version:=xlPivotTableVersion14 to Version:=xlPivotTableVersion12 it works just fine.
I'd like to know if there is an easy way to have it create v14 or v12 as needed depending on the version of Office in which it is opened?
Code:
ActiveWorkbook.PivotCaches.Create(SourceType:=xlDatabase, SourceData:= _
"WC_Summary!" & PTRng.Address, Version:=xlPivotTableVersion14).CreatePivotTable _
TableDestination:="PTChartData!R1C1", TableName:="PTWC", DefaultVersion _
:=xlPivotTableVersion14
If I change the portion Version:=xlPivotTableVersion14 to Version:=xlPivotTableVersion12 it works just fine.
I'd like to know if there is an easy way to have it create v14 or v12 as needed depending on the version of Office in which it is opened?