Consulting

Results 1 to 7 of 7

Thread: IE Automation through Excel for downloading a CSV File

  1. #1

    IE Automation through Excel for downloading a CSV File

    i am trying to automate a task of going to http://ad.easa.europa.eu/ and download a CSV file from the 'Export list as...' tab (refer picture in attachment for the exact link boxed out in red). i have been googleing and i have achieved the following code to open the website on IE so far....
    Sub Test()
        
        Dim cURL As String
        Dim IE As InternetExplorer
        
        cURL = "http://ad.easa.europa.eu/"
        Set IE = New InternetExplorer
        
        IE.Visible = True
        IE.Navigate cURL
        Do While IE.ReadyState <> READYSTATE_COMPLETE Or IE.Busy: DoEvents: Loop
        
    End Sub
    i tried to trigger 'click' but i am unable to find the right method to do it. any help or suggestion onto this would be very gr8...My ultimate aim is to download the CSV file to my desired location, get all the details of the CSV file into the excel sheet which executes this Macro.

    Thanks and regards
    KUmar
    Attached Images Attached Images

  2. #2
    VBAX Master
    Joined
    Jul 2006
    Location
    Belgium
    Posts
    1,286
    Location
    change
    cURL = "http://ad.easa.europe.eu"
    to
    cURL = "http://ad.easa.europe.eu/?format=csv&r=8588&sep=c"
    This will download a csv file to your standard download location on your computer.

  3. #3
    Thans alot Charlize.... it would be great on how you found the correct Url to the csv file. there are many such file download that can be automated at my office. your know-hows will help me alot in saving time, than to post again in this forum again....


    Best Regards
    Kumar

  4. #4
    VBAX Master
    Joined
    Jul 2006
    Location
    Belgium
    Posts
    1,286
    Location
    When you go to the menu item you want you :
    1. right click with the mouse instead of left clicking
    2. save the link as a html document
    3. open saved html document with textpad
    4. search for something with .csv or csv in the text
    5. s = semi colon / c = colon
    6. href.location is the base url
    7. add /?format and the rest of the text that you found in the saved html document that you opened with textpad

    no hidden tricks, just a bit of searching around and trial and error

    Charlize

  5. #5

  6. #6
    VBAX Newbie
    Joined
    Sep 2017
    Posts
    1
    Location
    Hi All,


    I too have similar requirement but after going to site I need to click on download button, after clicking download button a new pop-up window will open and from there I have to select few values from drop down and then click download. After clicking on download button it will download the csv file.

    And also the csv file is not available on site because I found nothing in HTML when I search for .csv or csv

    Thanks in advance

  7. #7
    Moderator VBAX Sage SamT's Avatar
    Joined
    Oct 2006
    Location
    Near Columbia
    Posts
    7,814
    Location
    Hi Indrasen,

    welcome to VBA Express, the best site on the internet,

    Hey, can you please start a new thread with your question?
    I expect the student to do their homework and find all the errrors I leeve in.


    Please take the time to read the Forum FAQ

Posting Permissions

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