Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Code slows on subsequent run

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.
  #2   Report Post  
Posted to microsoft.public.excel.programming
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

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Code slows on subsequent run

Hi Dave,

Thanks for your reply. I have been had by that speed
issue before and have learn't fom my ways. Although the
reports are inserting rows etc. They are not set to
sepecific break points or PGBreak Preview. This
[Breakpoint] is programatically done at the end of the
compile.

When set to ScreenUpdate = TRUE, you can noticably see
the difference during RunTime. The Process occurs at
almost a unnoticably quick rate (the screen is flickering
and Scrolling), where on the second run it is
significantly slower, you can see the chages & progress
as they occur.

There is no real spikes in Memory, CPU spikes during
runtime, but returns on the end. Everything seems in
order, but just wondering if there is a command line that
can clear cache or pagefile memory, or something like
that. Is there a time function to see the compile time?
Or the run-time, then maybe I could show you the interval
times of each separate instance.

Any more help would be great.

Thanks again.

Paul.
-----Original Message-----
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

.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,824
Default Code slows on subsequent run

I'm not quite sure what you mean by [breakpoint]. The problem is that excel
wants to determine where to put those little dotted lines after you insert
stuff.

If you turn this display off, then excel won't care.

At the top of many of my macros:

Dim CalcMode As Long
CalcMode = Application.Calculation
Application.Calculation = xlCalculationManual
ActiveSheet.DisplayPageBreaks = False

and near the bottom:

Application.Calculation = CalcMode
Application.ScreenUpdating = True

(Did you try it to see if it helped?)

And no, I don't know of a line of code that will do what you ask.

"Paul Mac." wrote:

Hi Dave,

Thanks for your reply. I have been had by that speed
issue before and have learn't fom my ways. Although the
reports are inserting rows etc. They are not set to
sepecific break points or PGBreak Preview. This
[Breakpoint] is programatically done at the end of the
compile.

When set to ScreenUpdate = TRUE, you can noticably see
the difference during RunTime. The Process occurs at
almost a unnoticably quick rate (the screen is flickering
and Scrolling), where on the second run it is
significantly slower, you can see the chages & progress
as they occur.

There is no real spikes in Memory, CPU spikes during
runtime, but returns on the end. Everything seems in
order, but just wondering if there is a command line that
can clear cache or pagefile memory, or something like
that. Is there a time function to see the compile time?
Or the run-time, then maybe I could show you the interval
times of each separate instance.

Any more help would be great.

Thanks again.

Paul.
-----Original Message-----
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

.


--

Dave Peterson

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Slows after about 1,000 records? Paul H[_2_] Excel Discussion (Misc queries) 3 June 3rd 09 01:21 PM
Filtering slows down a macro Curt D. Excel Worksheet Functions 1 October 13th 06 04:08 AM
Excel slows down for no(?) reason... thekovinc Excel Discussion (Misc queries) 0 December 6th 05 06:01 PM
ifsum slows down calculations Peter Nash Excel Worksheet Functions 2 September 10th 05 09:18 AM
VBA code slows to a snails crawl when screen saver activated Stephen Bain Excel Programming 2 October 30th 03 06:06 PM


All times are GMT +1. The time now is 02:34 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"