Update Web Query

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I was trying to use a macro to open a workbook that contains a web query and
then save and close the workbook. However, when I run the query the workbook
closes before the web query is run so the data isn't updated. How can I
delay the macro to allow the query to run correctly?
 
Rook

You can delay it by running some other dummy code using

Application.OnTime

Placing something like

Application.OnTime Now + TimeValue("00:00:15"), "DummyProcedure"

Will hold the file open for 15 seconds waiting for it to run
'DummyProcedure'

That sub could just be

Sub DummyProcedure()
Msgbox "Data Refreshed"
End Sub

--

HTH
Nick Hodge
Microsoft MVP - Excel
Southampton, England
(e-mail address removed)
web: www.nickhodge.co.uk
blog (non tech): www.nickhodge.co.uk/blog
 
I still didn't work. When I open the other workbook I am asked to enable the
automatic refresh, but when I try to record a macro and look back to see what
was created by the recording I don't see the automatic refresh addressed.
 
Back
Top