Excel VBA - updating charts via pivot tables

Posted on 2011-02-16
Medium Priority
Last Modified: 2012-05-11

I have a table in Excel that is automatically refreshed using code on opening the sheet.
The table is connected to a pivot table which is connected to a chart.
Errors occur because of these connections. Is there a way to get around this?
I tried to record the pivot table and chart generation but it was difficult because
you have first delete the existing ones and this gets messy
Question by:Murray Brown
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2

Accepted Solution

ragnarok89 earned 2000 total points
ID: 34910692
Try recalculating all sheets in the workbook. I assume your table, picot table, and cart are not all located on the same sheets.

For Each sh In ActiveWorkbook.Sheets
Next sh

or if you would prefer to specify which sheets get recalculated:


Use the above statement once for each sheet to be recalculated, where reference is the name of the sheet.

Author Closing Comment

by:Murray Brown
ID: 34910797
great worked. thanks

Expert Comment

ID: 34919337
My pleasure

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Some code to ensure data integrity when using macros within Excel. Also included code that helps secure your data within an Excel workbook.
When you see single cell contains number and text, and you have to get any date out of it seems like cracking our heads.
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa‚Ķ

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question