Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
I've Excel VBA macros which repetitively open 100+ data files (no more than 4 open at once), do heavy number-crunching, save results, then do it all over again a few hundred times with slight variations in parameters. It takes a week to run one of these, and using the Timer function I discovered that the time taken to do one iteration slowly increases from 10 minutes to over an hour (even though the data and calculations are the same) and despite all effort to close files as soon as finished, etc. I use Excel 2000 (9.0) and read in the Microsoft knowledge base that there are memory leak/slowdown bugs supposedly fixed by Service Release 1/1a, which I applied, to no effect. Then I tried installing Excel XP and found that the increasing slowdown still was there (and Excel XP in total runs noticeably slower than Excel 2000, so I’m back with Excel 2000). No error messages generated and it eventually successfully finishes, but it just slowly slows to a crawl as it runs. The OS is XP Home. Restarting Excel (without rebooting) gets it going fast again. Any suggestions as to where to look for this problem, how to narrow down or diagnose it, fix it, etc.? Thanks!

Having CPU/Ram: P4 2.5ghz 512mb I don't know why it slows down but is there room for improvement in the programming of your macro.
I once had a macro that performed 27 different functions for me. As a single macro it took about a minute to run.
I rewrote it as 27 separate macros and then created a 28th to run the other 27 and it completed it's task in 8 seconds which is a massive improvement.
Also, macros that include loops tend to go slow and they can often be replaced with a faster method.
I realize you are talking about a single macro that slows over time and use but if that macro is overworking to start with versus running efficiently then the problem would increase. Perhaps a better macro will not slow down over your project span.
Otherwise I do not know why Excel calculations slow over time and use.
Bryan

Can anyone say "Repetitious demand on resources"? It isn't just Excel, this will happen with any program where it is repeating the same limited sequence of tasks over and over. Not sure about the technicals of why it happens, but it is as if the system chokes. I look upon it as the system getting "tired", just as we would.

I have a similar problem with excel 2000. My machine dual boots in either w2k or w98se and I discovered that what takes 20 to 30 minutes under w2k takes less than 3 minutes under w98se. So I use w98se when I want to use excel 2000. I would love to find out how to correct in problem using w2k but will use w98se until then.

I just upgraded a windows 98se machine to windows 2000 and my excel macros have also slowed down to a crawl. The macros ran fine on the previouse operating system. I'm using office 2000. If anyone can help, I'd be much thankful.

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |