Solved

Control when a chart updates in Excel 2007 using VBA

Posted on 2011-02-21
2
587 Views
Last Modified: 2012-05-11
I have an application in Excel 2007 using VBA that places its results in a fixed location that is referred to by a chart, which is the primary output.  As the one thousand values are being placed in the output table, the chart updates after each one, which truns a one second process into a few minutes.

Is there a way to programatically prevent the chart from updating then force it to update at the end?
0
Comment
Question by:sjgrey
2 Comments
 
LVL 3

Accepted Solution

by:
byronwall earned 500 total points
Comment Utility
You can use the calculation property to switch to manual.  When you are done with your updating, switch back to auto and everything will update after a calculate call.  This is equivalent to changing the option on the Formulas -> Calculation Options menu if you want the non-VBA route.

Sub FasterExecution()
    
    'Switch to manual
    Application.Calculation = xlCalculationManual
    
    'Run your chart code.
    
    
    'Calculate and switch back to auto
    Application.Calculate
    Application.Calculation = xlAutomatic
    
End Sub

Open in new window

0
 
LVL 1

Author Closing Comment

by:sjgrey
Comment Utility
Perfect thanks
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

MS Access 2003 or later To MySQL Migration Project Hello All, this is my second article in the category of MS-OFFICE Automation. In internet I am not able to find any comprehensive resource on the Migration of MS Access back-end to MySQL so I fin…
This very simple solution applies to a narrow cross-section of the "needs to close" variety. In this case, the full message in Event Viewer was in applog, Event ID 1000: Faulting application iexplore.exe, version 8.0.6001.18702, faulting module …
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…
Graphs within dashboards are meant to be dynamic, representing data from a period of time that will change each time the dashboard is updated with new data. Rather than update each graph to point to a different set within a static set of data, t…

763 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

8 Experts available now in Live!

Get 1:1 Help Now