Hi,
Request help to modify the below VBA to refresh every 60 seconds.
Also any unwanted lines in this to be deleted
Sub webquery()
dt = Format(Now, "ddmmyyyyhhmmss")
url = "https://www.amfiindia.com/spages/NAVAll.txt?t=" & dt
With Worksheets("NAV_RawFormat").QueryTables.Add(Connection:="url;" & url, Destination:=Worksheets("NAV_RawFormat").Range("A1"))
.Name = "AMFI Query"
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.BackgroundQuery = False
.RefreshStyle = xlOverwriteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.WebSelectionType = xlEntirePage
.WebFormatting = xlWebFormattingNone
.WebPreFormattedTextToColumns = True
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = False
.WebDisableDateRecognition = False
.WebDisableRedirections = False
.Refresh BackgroundQuery:=False
End With
End Sub
Request help to modify the below VBA to refresh every 60 seconds.
Also any unwanted lines in this to be deleted
Sub webquery()
dt = Format(Now, "ddmmyyyyhhmmss")
url = "https://www.amfiindia.com/spages/NAVAll.txt?t=" & dt
With Worksheets("NAV_RawFormat").QueryTables.Add(Connection:="url;" & url, Destination:=Worksheets("NAV_RawFormat").Range("A1"))
.Name = "AMFI Query"
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.BackgroundQuery = False
.RefreshStyle = xlOverwriteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.WebSelectionType = xlEntirePage
.WebFormatting = xlWebFormattingNone
.WebPreFormattedTextToColumns = True
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = False
.WebDisableDateRecognition = False
.WebDisableRedirections = False
.Refresh BackgroundQuery:=False
End With
End Sub
Last edited: