Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Sub GetTSMData()
- '
- ' Makro1 Makro
- Dim URL As Variant
- Dim name As Variant
- URL = "TEXT;http://api.tradeskillmaster.com/v1/item/" & Range("Region").Value & "/" & Range("Realm").Value & Chr(63) & "format=csv_d&apiKey=" & Range("apiKey").Value
- name = Range("realm").Value & Chr(63) & "format=csv_d&apiKey=" & Range("apiKey").Value
- Worksheets("Data").Activate
- '
- With ActiveSheet.QueryTables.Add(Connection:=URL, Destination:=Range("$a$5"))
- .name = name
- .FieldNames = True
- .RowNumbers = False
- .FillAdjacentFormulas = False
- .PreserveFormatting = True
- .RefreshOnFileOpen = False
- .RefreshStyle = xlInsertDeleteCells
- .SavePassword = False
- .SaveData = True
- .AdjustColumnWidth = True
- .RefreshPeriod = 0
- .TextFilePromptOnRefresh = False
- .TextFilePlatform = 437
- .TextFileStartRow = 1
- .TextFileParseType = xlDelimited
- .TextFileTextQualifier = xlTextQualifierDoubleQuote
- .TextFileConsecutiveDelimiter = False
- .TextFileTabDelimiter = False
- .TextFileSemicolonDelimiter = False
- .TextFileCommaDelimiter = True
- .TextFileSpaceDelimiter = False
- .TextFileColumnDataTypes = Array(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1)
- .TextFileTrailingMinusNumbers = True
- .Refresh BackgroundQuery:=False
- End With
- End Sub
- Sub Refresh()
- ActiveWorkbook.RefreshAll
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement