Why would Excel react this way to this loop macro? Driving me crazy!

S

Shaka215

Hi fellow Guru's... I am curious as to why the following is causing my
macro to slow down after it loops like 50 times...

I have written some code to do the following...

1. A cell on "DataInput" contains a values; select the cell
2. Delete a sheet called "DataPull" and create a new spreadsheet
called "DataPull"
3. Conduct a web query from a website and output the results on
"DataPull"
4. Manipulate the imported data and update the cell on "DataInput"
from the spreadsheet "DataPull"
5. Jump down to the next cell "DataInput"
6. Go back to step # 1

Rinse and repeate... the problem is the code is lighting fast up until
the 50th+ loop. The process doesn't change... infact the only thing
that does change is just the value of the cell -- which would have no
impact it's query or how the information is pulled back. It seems to
be something with Excel and the creation/deletion of spreadsheets. I
don't understand why it would slow down if the process didn't change
after the first 49 numbers. The only thing that is changing is the
spreadsheet # when the sheet is created and new the value of the cell.
Anyone have any idea as to why this would slow the macro down to a
crawl once it hits the loop at 50+? It might even be something with
memory usage --- I've looked into how to get Excel to do a memory dump
and with the xlCalculation manual (helped but still didn't fix the
problem). I'm pulling my hair out about this one.

ANY help much appreciated!


-Shaka215
 
C

cht13er

Hi fellow Guru's... I am curious as to why the following is causing my
macro to slow down after it loops like 50 times...

I have written some code to do the following...

1. A cell on "DataInput" contains a values; select the cell
2. Delete a sheet called "DataPull" and create a new spreadsheet
called "DataPull"
3. Conduct a web query from a website and output the results on
"DataPull"
4. Manipulate the imported data and update the cell on "DataInput"
from the spreadsheet "DataPull"
5. Jump down to the next cell  "DataInput"
6. Go back to step # 1

Rinse and repeate... the problem is the code is lighting fast up until
the 50th+ loop. The process doesn't change... infact the only thing
that does change is just the value of the cell -- which would have no
impact it's query or how the information is pulled back. It seems to
be something with Excel and the creation/deletion of spreadsheets. I
don't understand why it would slow down if the process didn't change
after the first 49 numbers. The only thing that is changing is the
spreadsheet # when the sheet is created and new the value of the cell.
Anyone have any idea as to why this would slow the macro down to a
crawl once it hits the loop at 50+? It might even be something with
memory usage --- I've looked into how to get Excel to do a memory dump
and with the xlCalculation manual (helped but still didn't fix the
problem). I'm pulling my hair out about this one.

ANY help much appreciated!

-Shaka215

Don't post a new thread each day ... go back to your first one!
http://groups.google.com/group/micr...g/browse_thread/thread/869fbe4e5f7ca1b3?hl=en

Chris
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top