ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Macro taking longer every run (https://www.excelbanter.com/excel-programming/358918-macro-taking-longer-every-run.html)

Ron[_32_]

Macro taking longer every run
 
Hi Guys,

Can anyone tell me why a macro should take longer everytime I run it?

I have a bit of code, nothing special, that web queries about 500 rows of
data, 4 columns wide. The macro reduces this to about 100 rows and then
copies to a new sheet.

I have set it to a test of 5 days days, so 5 web queries each run.

It seems that if I continuosly run this macro, ie over the same set of data
it takes about 7 seconds longer each time.

So first run is 12 seconds, next is 19 then 25, 31,39,46 and 53.

If I close excel completely and open it and try again it reverts to the 12
seconds first run.

Any idea why this is?


Regards,

Ron

Norman Jones

Macro taking longer every run
 
Hi Ron,

See the MSKB Article # 319998
'BUG: Memory leak occurs when you query an open Excel worksheet
by using ActiveX Data Objects (ADO)'

http://tinyurl.com/nexcb


---
Regards,
Norman



"Ron" wrote in message
...
Hi Guys,

Can anyone tell me why a macro should take longer everytime I run it?

I have a bit of code, nothing special, that web queries about 500 rows of
data, 4 columns wide. The macro reduces this to about 100 rows and then
copies to a new sheet.

I have set it to a test of 5 days days, so 5 web queries each run.

It seems that if I continuosly run this macro, ie over the same set of
data
it takes about 7 seconds longer each time.

So first run is 12 seconds, next is 19 then 25, 31,39,46 and 53.

If I close excel completely and open it and try again it reverts to the 12
seconds first run.

Any idea why this is?


Regards,

Ron




Ron[_32_]

Macro taking longer every run
 
"Norman Jones" wrote in
:

http://tinyurl.com/nexcb


Thanks Norman.

As I'm not using ADO it isn't a complete explanation. However I'm sure
there's some connection there as I also have to close excel to get the
runtime back to a basic 12 seconds.

I initially thought it might be the clipboard filling up but that proved
not to be the case when I manually cleared it after every run.


Thanks again

Ron


All times are GMT +1. The time now is 08:04 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com