Solved

VBA chart-drawing excel macro CPU/Memory optimization

Posted on 2004-04-27
5
527 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

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…
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
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…

691 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