+ Reply to Thread
Results 1 to 4 of 4

Vba to extract data from a web site

  1. #1
    Registered User
    Join Date
    08-28-2012
    Location
    wisbech england
    MS-Off Ver
    Excel 2003
    Posts
    7

    Vba to extract data from a web site

    Hi all , this is my first post I hope I get across my idea clearly ( my first web VBA please be gentle ):

    What I want to achieve:

    1) open a web page http://www.bmreports.com/bwh_Mid.htm
    2) insert date and period in the text box and click "go"
    3) once the data is displayed I need to import them in eirther excel or access

    I found lot of problem in inserting data and periods in the textbox , unfortunately the web queries are not displayed in the browser
    Below the code I have used :
    Please Login or Register  to view this content.
    below the web code:
    HTML Code: 
    Last edited by Leith Ross; 08-28-2012 at 04:24 PM. Reason: Addec Code and HTML Tags

  2. #2
    Valued Forum Contributor
    Join Date
    05-21-2009
    Location
    Great Britain
    MS-Off Ver
    Excel 2003
    Posts
    550

    Re: Vba to extract data from a web site

    You don't need IE automation and HTML DOM parsing to extract this data. Instead, a web query is the simplest way, as long as you specify the correct parameters and values in the query string (the part of the URL after the ? character). Something like this:
    Please Login or Register  to view this content.
    That's just a web query generated by the macro recorder and I tweaked the code to declare the URL string. In this example I hard-coded the date (param0) and period (param1) values, but you will want to specify your own values from user inputs. Use Format function to format the input date as yyyy-mm-dd: Format(theDate, "yyyy-mm-dd").
    Post responsibly. Search for excelforum.com

  3. #3
    Registered User
    Join Date
    08-28-2012
    Location
    wisbech england
    MS-Off Ver
    Excel 2003
    Posts
    7

    Re: Vba to extract data from a web site

    thanks a lot it works beautifully, i also tried to build it but i missed displayCsv thank you very much

  4. #4
    Registered User
    Join Date
    08-28-2012
    Location
    wisbech england
    MS-Off Ver
    Excel 2003
    Posts
    7

    Re: Vba to extract data from a web site

    in any case are u able to answer to my original question???( in case i would like to use IE automation and HTML DOM ) thanks

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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