Web queries: button v code
G'day all,
I have a sheet with a button. To the button is attached
a macro. The macro retrieves data via a web query
and collects the data into an Access table. The button
is manually activated a variable number of times during the day,
sometimes several times, sometimes more than 100 times.
The web queries are not identical but pick up an ID number
before each run.
Everything works OK.
I decided to automate this manual procedure by replacing
the manual part by code which feeds the new ID number to
the web query each time. However the code usually runs for
anything from approx 15 to 80 times then hangs.
Task Manager indicates Excel is using something like
40MB. I have tried various things such as deleting the sheet
and restablishing the query each time but to no avail.
The fact that the web query seems to run any number of times
when manually fired seems to suggest that there may be a timing
issue here but only a guess.
Any suggestions appreciated!
Cheers, Peter J.
|