Solved

VBA chart-drawing excel macro CPU/Memory optimization

Posted on 2004-04-27
5
515 Views
Last Modified: 2010-05-18
Hi,

I'm not sure if this is the right place to ask...But here it is.

I have 200 columns and 40 rows long sheet in Excel and I have coded a Macro to plot charts of every column agains every other (to understand correlation between the data).

Now the problem is that while plotting, with ScreenUpdate=False, my CPU utilization shoots up to 100% ...plotting hundreds of those charts in new sheets (one per column under consideration)! ....and it takes FOREVER..to finish it........

Please let me know if you know of a trick or optimization to reduce my CPU and MEMORY utilization for such a macro!

Thanks (hope I explained it well!)
~essjthakkar
0
Comment
Question by:essjthakkar
5 Comments
 
LVL 6

Expert Comment

by:LunaSkye
ID: 10934647
Hi,
Im not exactly sure if i understand it,  but alot of times, if you have stuff visible it takes longeer just becuase of the refreshes.  Try makking each chart     .visible = false  until you have filled it, then turn it visible.

Also, maybe if you throw a "DoEvents" statement in the loop.  That way, after each iteration, you give the computer a chance to process other events on the system.

-Andrew
0
 

Author Comment

by:essjthakkar
ID: 10954861
Ok, about the Visible=false idea, is this possible ?  (algorithmic steps...)

repeat:
    create chart object
    Set the chart to visible=false,
    Populate the chart :  get chart data, set the title, etc.
    Set the chart to visible=true now, since its ready.
go to "repeat" for another chart

I tried setting Visible=false before actually populating the chart, but apparently, it gave me an Error!  IS IT NOT possible to set a chart to invisible and THEN populate it?

:S
~Siddharth
0
 
LVL 1

Accepted Solution

by:
DarthMod earned 0 total points
ID: 11464194
PAQed, with points refunded (125)

DarthMod
Community Support Moderator
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

829 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