ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   refresh query (https://www.excelbanter.com/excel-programming/273748-refresh-query.html)

bob

refresh query
 
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




All times are GMT +1. The time now is 05:52 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com