Excel 2010 - vba/Access 97
I have a vba routine that runs nice and quick at the start but then gets slower and slower
as it loops. I am parsing downloaded documents from the internet. Each document is similar --
only very minor changes in text from one doc to the next.
For each document, the parser will consult a database of html tags about a thousand times. I use
the command rs.seek to find a corresponding substitution for each html tag. It is this "seek" operation
that is slowing down. I put the line
T1 = TIMER
before the "seek" command, and the line
T2 = TIMER
afterwards. Then I sum up the thousand time measurements for each document to find out
how much time is spent by the cpu executing that one line of code. This is where it is spending
most of its time, and the time spent on that line grows in parallel with total processing time.
Here is a picture of time spent on the "seek" line of code for the first 30 documents that were
parsed.http://www.frontiernet.net/~wily11/seekTime.GIF
I'm really drawing a blank as to what sort of mechanism is involved in this slowdown. My only
thought was bad management of variables, but I did what troubleshooting I could think of in that
regard. Tried closing the recordset and database after each document and setting their variables to
Nothing. That's about it. Closing the spreadsheet and reopening does not help. It will resume at its
most recent speed. Closing Excel will reset it to optimal speed.
Thanks for looking.
Shockley