PDA

View Full Version : Macro to create and export multiple Pivot charts



deltaquattro
05-25-2011, 06:02 AM
Hi guys,

I wrote a VBA code in Excel 2000 which automatically generates Pivot Charts from some data and exports them in a new workbook. This nifty piece of code worked fine...until I had to migrate to Office 2007, that is http://www.mrexcel.com/forum/images/smilies/frown.gif

The issue is the following: I create Pivot Tables and associated Pivot Charts in worbook Test.xlsm, and this works fine. I then try to export them to a separate workbook, PivotReport.xlsx. When I do this, the "link" between the Pivot Tables and the Pivot Charts is broken, and my charts now become ordinary Chart sheets, so I cannot change the Field Items, I cannot filter them, etc.
I enclose the sample workbook, where I put a simplified version of the code. The problem appears when the subroutine MoveSheetsToWorkbook is executed: until that point, the Pivot Charts are still real Pivot Charts, with the associated Tags.
I attach an example workbook: let me know if you need more info,

thanks

Sergio Rossi