refresh query

B

bob

i am trying to refresh a query every 10 min.
using the .RefreshPeriod = 10 in the query loop doesn't redue all of the
macro formatting that follows query so i was wondering if refresh could be
used in a sub to run the main macro. something like this

sub refresh()
Application.Run "'TEST.XLS'!GetData"
..RefreshPeriod = 10
End Sub

or how would i automate running the macro.

this is the query loop in main macro
Workbooks.Add
With ActiveSheet.QueryTables.Add(Connection:=connectURL,
Destination:=Range("A1"))
.BackgroundQuery = True
.TablesOnlyFromHTML = True
.PostText = "TICKER=" & Symbol
.refresh BackgroundQuery:=False 'DL text data
.RefreshPeriod = False 'no refresh
.SaveData = True
End With

thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top