Thread: [Solved] VBA and web data
View Single Post
 
Old 01-15-2014, 12:53 PM
YounesB3 YounesB3 is offline Windows XP Office 2010 32bit
Advanced Beginner
 
Join Date: Jul 2012
Posts: 37
YounesB3 is on a distinguished road
Default

Thanks a lot!

New error : run-time error 1004 : invalid web query.

This is where it bugs (highlighted below):

Code:
Sub Test()

Sheets("Temp").Select

URL = "URL;http://www.metacritic.com/search/all/results?cats[game]=1" & Range("L4").Value

With ActiveSheet.QueryTables.Add(Connection:=URL, Destination:=Range("M5"))
        .Name = "test"
        .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 = "5"
        .WebPreFormattedTextToColumns = True
        .WebConsecutiveDelimitersAsOne = True
        .WebSingleBlockTextImport = False
        .WebDisableDateRecognition = False
        .WebDisableRedirections = False
        .Refresh BackgroundQuery:=False
    End With
Reply With Quote