Solved

Excel VBA - updating charts via pivot tables

Posted on 2011-02-16
3
269 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

SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

Question has a verified solution.

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

A little background as to how I came to I design this code: Around 5 years ago I designed an add-in that formatted Excel files to a corporate standard, applying different cell colours and font type depending on whether the cells contained inputs,…
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 will demonstrate in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.
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…

696 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