EXCEL 2007 CHART REFRESH WHILE MACRO IS RUNNING


M

MikeM

I've written a VBA macro that performs repetetive calculations in an Excel
worksheet. Data from the spreadsheet is displayed in an embedded chart (X-Y
Scatter Plot). I want to watch the chart update while the macro runs.

In Excel 2003 the macro works as intended. In Excel 2007 I see data in the
spreadsheet updating but the chart does not.

I'm running on two different office PCs, Windows XP installed on both,
Office 2003 on one, Office 2007 on the other. I've tried both .xls and .xlsm
file formats on the Office 2007 machine with the same result.

I added a Chart.Refresh line to my code, but still no joy (the macro runs,
but the chart doesn't update until execution ends).

Can't seem to find any pertinent help. Any suggestions (other than convince
my company to revert back to Office 2003)?
 
Ad

Advertisements

T

Tushar Mehta

See the replies to your post in .programming.

--
Tushar Mehta
http://www.tushar-mehta.com
Custom business solutions leveraging a multi-disciplinary approach
In Excel 2007 double-click to format may not work; right click and select
from the menu
 
Ad

Advertisements

Joined
Dec 15, 2009
Messages
1
Reaction score
0
Re: EXCEL CHART REFRESH WHILE MACRO IS RUNNING

I had the same problem, found two solutions. At the point you want the chart refreshed, add either of the following lines:

Application.Calculate

or

ActiveSheet.Calculate

I also found that if a macro uses the ClearContents method on any cells in the sheet containing the chart then the chart gets refreshed. Happy days!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top