?
Solved

Excel VBA - updating charts via pivot tables

Posted on 2011-02-16
3
Medium Priority
?
275 Views
Last Modified: 2012-05-11
Hi

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
0
Comment
Question by:Murray Brown
  • 2
3 Comments
 
LVL 8

Accepted Solution

by:
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
    sh.Calculate
Next sh


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

Worksheets(reference).Calculate

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

Author Closing Comment

by:Murray Brown
ID: 34910797
great worked. thanks
0
 
LVL 8

Expert Comment

by:ragnarok89
ID: 34919337
My pleasure
0

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

This article will guide you to convert a grid from a picture into Excel format using Microsoft OneNote and no other 3rd party application.
Excel can be a tricky bit of software to get your head around. Whilst you’ll be able to eventually get to grips with the basic understanding of how to get by, there are a few Excel tips that not everybody will even know about let alone know how to d…
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…
This Micro Tutorial demonstrate the bugs in Microsoft Excel for Mac with Pivot Charts.

840 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