I followed some tutorials on how to get tables into excel using VBA and ended up with this short piece of code:
Public Sub UseQueryTable()
Dim url As String
url = "https://ec.europa.eu/eurostat/databrowser/view/PRC_HICP_MIDX/default/table?lang=en&category=prc.prc_hicp"
Dim table As QueryTable
Set table = Sheet1.QueryTables.Add("URL;" & url, Sheet1.Range("A1"))
With table
.WebSelectionType = xlSpecifiedTables
.WebTables = 1
.WebFormatting = xlWebFormattingAll
.Refresh
End With
End Sub
However when i run it, i get a response that “web query returned no data”
Am i referencing the table wrong?
Why is it returning no data?