Solved

Excel VBA - updating charts via pivot tables

Posted on 2011-02-16
3
266 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:murbro
  • 2
3 Comments
 
LVL 8

Accepted Solution

by:
ragnarok89 earned 500 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:murbro
ID: 34910797
great worked. thanks
0
 
LVL 8

Expert Comment

by:ragnarok89
ID: 34919337
My pleasure
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Introduction This Article briefly covers methods of calculating the NPV and IRR variants in Excel as well as the limitations in calculating and interpreting IRR results. Paraphrasing Richard Shockley, author of my favourite finance reference tex…
Some code to ensure data integrity when using macros within Excel. Also included code that helps secure your data within an Excel workbook.
The view will learn how to download and install SIMTOOLS and FORMLIST into Excel, how to use SIMTOOLS to generate a Monte Carlo simulation of 30 sales calls, and how to calculate the conditional probability based on the results of the Monte Carlo …
This Micro Tutorial demonstrate the bugs in Microsoft Excel for Mac with Pivot Charts.

914 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now