Results 1 to 4 of 4

Web query with QueryTables

Threaded View

  1. #1
    Registered User
    Join Date
    05-30-2009
    Location
    France
    MS-Off Ver
    Excel 2003
    Posts
    4

    Web query with QueryTables

    Hello,
    I am having problems getting to work a web query in a VBA macro. The goal is simply to get a value retrieved from a web query into an excel cell.

    The below code works well with standard html pages (like replacing the url with www.google.com). However, the page I want to retreive (a query at geonames.org that retreives an altitude value for given lattitude/longitude values) does not contain any HTML headers, but just a number in plain text. In this case the below query does not returns anything. I tried different formating options for the query but up to nownothing works. Any idea how to solve this ? Thanks in advance !


     
    With ActiveSheet.QueryTables.Add(Connection:= _
            "URL;http://ws.geonames.org/srtm3?lat=50.01&lng=10.2" _
            , Destination:=Range("G1"))
            .Name = "testme"
            .RowNumbers = False
            .RefreshOnFileOpen = False
            .BackgroundQuery = True
            .SaveData = True
            .WebSelectionType = xlEntirePage
            .WebFormatting = xlWebFormattingNone
            .WebPreFormattedTextToColumns = True
            .WebSingleBlockTextImport = True
            .WebDisableDateRecognition = False
            .Refresh BackgroundQuery:=True
        End With
    Last edited by fredoman; 06-03-2009 at 06:16 PM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1