ercedwards
Board Regular
- Joined
- Apr 27, 2013
- Messages
- 125
I have the following macro which has worked for ages until the web page format changed.
Now, this macro still pulls most of the data but doesn't retrieve the real data I need which is the actual fire runs below the headings.
Can anyone help. You can drop this macro into any blank workbook to see what I mean.
Thanks much.
Now, this macro still pulls most of the data but doesn't retrieve the real data I need which is the actual fire runs below the headings.
Can anyone help. You can drop this macro into any blank workbook to see what I mean.
Thanks much.
Code:
Sub Download()
Worksheets("CADScreen").Select
On Error GoTo CADDown
Application.ScreenUpdating = False
Range("A:AZ").Select
Selection.ClearContents
With ActiveSheet.QueryTables.Add(Connection:= _
"URL;https://www.toronto.ca/community-people/public-safety-alerts/alerts-notifications/toronto-fire-active-incidents/#main", Destination:=Range("$A$1"))
.Name = "TFSCad"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.BackgroundQuery = True
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = False
.RefreshPeriod = 0
.WebSelectionType = xlEntirePage
.WebFormatting = xlWebFormattingNone
.WebPreFormattedTextToColumns = True
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = False
.WebDisableDateRecognition = False
.WebDisableRedirections = False
.Refresh BackgroundQuery:=False
Range("A1").Select
End With
GoTo CADOK
CADDown:
Range("A1") = "CAD is Down"
GoTo Done
CADOK:
Range("J1") = ""
Application.ScreenUpdating = True
Done:
End Sub