?
Solved

VBA chart-drawing excel macro CPU/Memory optimization

Posted on 2004-04-27
5
Medium Priority
?
534 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
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…
Suggested Courses
Course of the Month8 days, 2 hours left to enroll

765 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