I have some old code that used to work but it doesn't now. My goal is to download data from a website. In this test case the URL is "https://flightaware.com/live/flight/FHPJA/history/1280?filterStart=2017-12-01&filterEnd=2017-12-31
" What I want to download is the ACTIVITY LOG table data.
Right now I'm getting this error message:
'Run-time error '1004':
'Method 'Range' of object'_Global' failed
Here's the code. I'm wondering, among other things, if there's a reference in the VB Editor that I need to enable for the code to work.
With ActiveSheet.QueryTables.Add(Connection:= _
.Name = "FHPJA"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.BackgroundQuery = True
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.WebSelectionType = xlSpecifiedTables
.WebFormatting = xlWebFormattingNone
.WebTables = "2"
.WebPreFormattedTextToColumns = True
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = False
.WebDisableDateRecognition = False
.WebDisableRedirections = False