wailingrecluse
07-28-2009, 11:51 PM
Hi there
I hope someone can help.
I have a web query in an excel spreadsheet, which refreshes every 2 minutes.
Does anyone know how to automate a macro, so that it runs when the web query has refreshed?
Thanks a lot,
WR
ajetrumpet
07-28-2009, 11:59 PM
how about using a timer and resetting it every 2 minutes? wouldn't that work?
wailingrecluse
07-29-2009, 12:22 AM
how about using a timer and resetting it every 2 minutes? wouldn't that work?
Hi
Is this something I need to write in VBA?
Or is it a setting?
WR
ajetrumpet
07-29-2009, 01:12 PM
Hi
Is this something I need to write in VBA?
Or is it a setting?
WRyou need to write it in your code. something like this:dim starttime as variant, secondsBeforeRefresh as variant
while time() < 17:00
starttime = timer()
secondsBeforeRefresh = 120
while starttime < secondsBeforeRefresh
do events
wend
PERFORM YOUR MACRO HERE
wendsomething like that should run your macro after every two minutes is passed from the time it is initiated until 5pm at night. the time code might have to be changed a tad though. i probably wrote it incorrectly. it was not tested.