View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Ben McClave Ben McClave is offline
external usenet poster
 
Posts: 173
Default Please help! Cannot open pivotTable source file....

Bobby,

I think that you may need to change the existing PivotTables' PivotCache, rather than using the Wizard method. Try this code to see if it works better for you:

For Each ws In ActiveWorkbook.Worksheets
For Each pt In ws.PivotTables
tmp = pt.SourceData
tmp1 = Replace(tmp, "2011-2012", "2012-2013")
pt.ChangePivotCache ActiveWorkbook. _
PivotCaches.Create(SourceType:=xlDatabase, SourceData:= _
tmp1, Version:=xlPivotTableVersion14)
tmp = ""
tmp1 = ""
Next pt
Next ws