View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson[_3_] Dave Peterson[_3_] is offline
external usenet poster
 
Posts: 2,824
Default Code slows on subsequent run

I'm guessing that if you're doing something with items to be included in a
report, then maybe you're hiding or deleting rows.

Maybe adding something like:
ActiveSheet.DisplayPageBreaks = False

will speed up your code--xl won't try to determine where those little dotted
lines go after each deletion/hide.

"Paul Mac." wrote:

Hi All,

Currently I have a report being generated by a series of
for each statements. This in total requests approximately
15,000 range validations. On top of this there are checks
and validations from collection objects for the item to
be included in the report.

The issues is:

On the first pass of running the report, it completes in
approximately 3 Seconds. After that, it takes over 30.
I'm wondering if any variables are loaded into memory
that are slowing the process down. An intial selection is
made from a calendar form (not MSCAL.ocx). Which has not
been unloaded at this stage.

Is it possible to clear the memory (as if you had closed
& re-opened excel) at the completion of the report?

Compile is Option Explicit, so there are no un-declared
variables.

XL XP

Ideas, anyone?

Thanks in advance.

Paul Mac.


--

Dave Peterson