Consulting

Results 1 to 4 of 4

Thread: Sleeper: Problem downloading data from Web

  1. #1
    VBAX Regular
    Joined
    Jun 2005
    Posts
    6
    Location

    Question Sleeper: Problem downloading data from Web

    I use ActiveWorkbook.FollowHyperlink (URL) in VBA macros where URL is a link of .xls file on the Web.

    I want to open downloaded document in active Excel application and after use data from it in my macros, but I experienced some problems.

    If I call this function from Excel the data is not downloaded, but when I call it from VBA Redactor using breakpoints in this special regime all work fine: data is downloaded and I can use it with my macros. I don?t understand how I can rewrite my program that it will work when I?ll call it directly from Excel.

  2. #2
    Site Admin
    Jedi Master
    VBAX Guru Jacob Hilderbrand's Avatar
    Joined
    Jun 2004
    Location
    Roseville, CA
    Posts
    3,712
    Location
    It may be that you are not allowing enough time for the file to download and the macro rushes on. With break points you are going slower.

    Can you post the relevant code to your question and maybe we can help.

  3. #3
    VBAX Regular
    Joined
    Jun 2005
    Posts
    6
    Location
    Sub Open4Pages()
    For i = 1 To 3
    URL = "http://cbonds.info/quotes/index.php?...uotesForm&form_" & _
    "submitted=quotesForm&region_id=0&country_id%5B%5D=1&sector_id=1&emitent_substring=&" & _
    "emitent_id%5B%5D=0&paper_type_id=0&currency=0&ground_id%5B%5D=1&ground_id%5B%5D=2" & _
    "&ground_id%5B%5D=3&ground_id%5B%5D=5&search_method=0&emission_id%5B%5D=0&begin_date=" & _
    "05%2F02%2F2005&end_date=07%2F18%2F2005&rows_on_page=30&fields%5B%5D=0&fields%5B%5D=1&" & _
    "fields%5B%5D=2&fields%5B%5D=3&fields%5B%5D=4&fields%5B%5D=5&fields%5B%5D=6&fields%" & _
    "5B%5D=7&fields%5B%5D=8&fields%5B%5D=9&fields%5B%5D=10&fields%5B%5D=11&fields%5B%5D" & _
    "=12&fields%5B%5D=13&fields%5B%5D=14&fields%5B%5D=15&fields%5B%5D=16&fields%5B%5D=17" & _
    "&fields%5B%5D=18"
    ActiveWorkbook.FollowHyperlink (URL), NewWindow:=True
    newHour = Hour(Now())
    newMinute = Minute(Now())
    newSecond = Second(Now()) + 60
    waitTime = TimeSerial(newHour, newMinute, newSecond)
    Application.Wait waitTime
    Next i
    End Sub
    I use Excel 2000
    In download boxs I press "Open now" but after macros finished I have no additional Excel windows with downloaded data (((

  4. #4
    VBAX Regular
    Joined
    Jun 2005
    Posts
    6
    Location
    HTML Code:
     [url]http://cbonds.info/quotes/index.php?report_type=xls&form=quotesForm&form_submitted=quotesForm&region_id=0&country_id%5B%5D=1&sector_id=1&emitent_substring=&emitent_id%5B%5D=0&paper_type_id=0&currency=0&ground_id%5B%5D=1&ground_id%5B%5D=2&ground_id%5B%5D=3&ground_id%5B%5D=5&search_method=0&emission_id%5B%5D=0&begin_date=05%2F02%2F2005&end_date=07%2F18%2F2005&rows_on_page=30&fields%5B%5D=0&fields%5B%5D=1&fields%5B%5D=2&fields%5B%5D=3&fields%5B%5D=4&fields%5B%5D=5&fields%5B%5D=6&fields%5B%5D=7&fields%5B%5D=8&fields%5B%5D=9&fields%5B%5D=10&fields%5B%5D=11&fields%5B%5D=12&fields%5B%5D=13&fields%5B%5D=14&fields%5B%5D=15&fields%5B%5D=16&fields%5B%5D=17&fields%5B%5D=18[/url]
    Sorry the link in URL has been posted wrongly? this is a better one

Posting Permissions

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