I have 2 functions which I am calling one after the other to dump the tables into excel. Function1 runs fine however, function 2 returns the same data as Function1
If I hard code Function2 as >statslink = "
then all works fine??
I've checked the values and types for the expression and all seems ok
Variables 'webaddressgetracelinks' and 'webaddressgettrainerstats' both ="
Can anyone see a problem or is there a way to delete the data held by the first Function1?
Function1
Function2
Many thanks,
Os
If I hard code Function2 as >statslink = "
then all works fine??
I've checked the values and types for the expression and all seems ok
Variables 'webaddressgetracelinks' and 'webaddressgettrainerstats' both ="
Can anyone see a problem or is there a way to delete the data held by the first Function1?
Function1
Code:
Set QT = ActiveSheet.QueryTables.Add(Connection:="URL;" & webaddressgetracelinks, Destination:=ActiveCell)
With QT
.FieldNames = True
.RowNumbers = False
.BackgroundQuery = False
.RefreshStyle = xlOverwriteCells
.SaveData = True
.AdjustColumnWidth = False
.WebSelectionType = xlEntirePage
.WebFormatting = xlWebFormattingNone
'.WebTables = "1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20"
.WebPreFormattedTextToColumns = True
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = True
.WebDisableDateRecognition = True
.WebDisableRedirections = True
.Refresh BackgroundQuery:=False
End With
Function2
Code:
Function gettrainerstats(webaddressgettrainerstats As String)
statslink = webaddressgettrainerstats & "&data=statistics"
With ActiveSheet.QueryTables.Add(Connection:= _
"URL;" & statslink _
, Destination:=Range("c100"))
.FieldNames = True
.RowNumbers = False
.BackgroundQuery = False
.RefreshStyle = xlOverwriteCells
.SaveData = False
.AdjustColumnWidth = False
.WebSelectionType = xlEntirePage
.WebFormatting = xlWebFormattingNone
.WebSelectionType = xlSpecifiedTables
.WebFormatting = xlWebFormattingNone
.WebTables = "5"
.WebPreFormattedTextToColumns = True
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = True
.WebDisableDateRecognition = True
.WebDisableRedirections = True
.Refresh BackgroundQuery:=False
End With
Many thanks,
Os