+ Reply to Thread
Results 1 to 8 of 8

How to link excel and a website

  1. #1
    Registered User
    Join Date
    08-05-2010
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    5

    How to link excel and a website

    --------------------------------------------------------------------------------

    Hi,

    Everyday we need to update data that is on a website.(www.gocompare.com) to an excel sheet I maintain. Is it possible to write a VBA code to automate this process?

    eg: it should refer the data relevant for today and insert the number in the excel sheet. What I currently do is manually inserting it.
    If I can automate it, then by the press of a button, I can automate it when the data is released for tomorrow.

    Can you please let me know whether VBA can do this. If not is there anyother way I can do this?

    Many thanks,

  2. #2
    Registered User
    Join Date
    07-29-2010
    Location
    Chicago
    MS-Off Ver
    Excel 2007
    Posts
    9

    Re: How to link excel and a website

    You can absolutely grab data from the web using VBA. I use the DOM (Document Object Model). Following is some sample code (sloppy) that I wrote for pulling data from DRF.com

    Please Login or Register  to view this content.
    Regards,
    Eddie

  3. #3
    Registered User
    Join Date
    08-05-2010
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: How to link excel and a website

    hi..thank you for the reply...I will try and amend the code and see if it works.
    Else shall I attach attach my sample excel sheet and the screenshot of the webpage for you to get a better idea?

    Thanks once again

  4. #4
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: How to link excel and a website

    You'd better use the builtin Excel-facility Webquery.
    No need for VBA.

    Menu Bar/Data/external data/webquery. And use the wizard.

  5. #5
    Registered User
    Join Date
    08-05-2010
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: How to link excel and a website

    Thanks for the reply. But I get the following error. Do you know how to avoid

    Use of default namespace declaration attribute in DTD not supported.

    Please let me know

    thanks

  6. #6
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: How to link excel and a website

    In the attachment I implemented a webquery for gocompare.
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    08-05-2010
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: How to link excel and a website

    Is there a way to work around the error I am getting?

  8. #8
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: How to link excel and a website

    I don't get any errors.
    But you can try this macro in a new worksheet:

    Please Login or Register  to view this content.

+ Reply to Thread

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