Chart from pivottables, cache issue

albclim

New Member
Joined
Sep 11, 2010
Messages
4
Hi Experts

You may help in this one.
I have a workbook that open and copy another workbook (with one sheet).
Thiworkbook copied contains 17 columns and an increasing number of cells (right now about 180). It change fortnight and I run a macro that:
-copy the workbook
-display a report with data in visual manner.
-create pivot tables as request
-verify if report has been copied, tables created,

Now, I have those pivot tables and would like to create a chart for each table.
I have the following code (appologies for the code as HTML Maker does not work, and appologies for the spanish words :)

tipogra on array for the few grafic choices availables
posigraf1 for the chart start cell (array)
posigraf2 for the chart end cell (array)
tableta with the pivottable range

For z = 0 To 7
tabladin = "Tabla dinámica" & (z + 1)
Worksheets("grafi").Shapes.AddChart(tipogra(z), _
Left:=Worksheets("grafi").Range(posigraf1(z)).Left, _
Top:=Worksheets("grafi").Range(posigraf1(z)).Top, _
Width:=Worksheets("grafi").Range(posigraf2(z)).Width, _
Height:=Worksheets("grafi").Range(posigraf2(z)).Height).Select
ActiveChart.SetSourceData Source:=Worksheets("Tabla").Range(tableta(z))
ActiveChart.ChartStyle = 1
ActiveChart.ApplyLayout (4)
Next z


SO far the code works fine, display the choosen graf types, located and right layout, but....
it display the first pivottable data only. The pivot tables works perfectly.
I have tried different codes to clean the cache but nothing works.

I will appreciate your help

Many Thanks
Alb
 

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.

Forum statistics

Threads
1,213,529
Messages
6,114,155
Members
448,554
Latest member
Gleisner2

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top