Macro, Efficiency and Memory

Monsignor

Board Regular
Joined
May 30, 2011
Messages
162
I'm experiencing this for the first time:
I'm using Excel to import about 20,000 web pages. I've noticed that Excel started off flying: 1 page every 3 seconds. Around 1000 it was noticeably slower. Around 2000 it was pulling 1 page every 30 seconds.

One thing I've been doing is stop the macro, cut the pages that are imported, paste them into another workbook, and then restart the macro.

Also, it seems to help a little to completely shut Excel down before re-starting the macro. And when I start, it's the same thing. Starts off great and then slows to a crawl.

What's happening inside Excel? Inside the computer? Am I really doing any good to shut Excel down occasionally? Is there a cache somewhere that needs to be emptied?
 

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
Hello Monsignor,

It is difficult to provide a specific answer when the macro code is absent. Regardless of the method you are using to import the data, that is a lot of web sites. Not every web site is going to respond in the same amount time and most importing is done synchronously. The macro will wait for a response or until the site times out before moving to the next site.
 
Upvote 0
It probably would not hurt to have a workbook.Save built into an IF,,,ElseIf...Then, or a Select Case or some other statemet after every two or three hundred pages are imported. That would free up some memory and might prevent the big slow down.
 
Upvote 0

Forum statistics

Threads
1,214,535
Messages
6,120,093
Members
448,944
Latest member
SarahSomethingExcel100

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top