+ Reply to Thread
Results 1 to 9 of 9

Extract Table data from web page to excel

  1. #1
    Valued Forum Contributor Naveed Raza's Avatar
    Join Date
    11-04-2012
    Location
    India, Hyderabad
    MS-Off Ver
    Excel, Access 2007/2010
    Posts
    1,338

    Extract Table data from web page to excel

    Hi All,

    i am need of help in below query.

    query is, i have some list of ID and each id need to paste on website click on submit and will reflect table and that table need to paste in excel.

    Note: Main page of entering number and clicking on submit that URL and after submitting of whatever page reflect that URL both are same

    i have written the below code, however which i facing are below

    scenarios

    1. its works fine when i do manually means step by step by pressing F8, if i run at once by pressing F5, its not capturing data.
    2. its works fine when i do manually means step by step by pressing F8 or by pressing F5, but at "getelementbytagname" line its giving as "Object variable not set", and we click on debug button and after pressing debug button , if i press again F8 its working.

    why this happening im unable to understand, below is my code.

    Note: Sorry i cant provide the website link as its very sensitive.

    Please Login or Register  to view this content.
    Last edited by Naveed Raza; 02-10-2016 at 11:03 AM.
    Thanks - Naveed
    -----------------------------
    If the suggestion helps you, then Click * to Add Reputation
    To Attach File: Go Advanced>>Manage Attachments>>Add Files (In Top Right Corner)>>SelectFiles>>.........Locate Your File(s)>>Upload Files>>Done (In Bottom Right)
    1. Use [code] code tags [\code]. It keeps posts clean, easy-to-read, and maintains VBA formatting.
    2. If you are happy with a solution to your problem, mark the thread as [SOLVED] using the tools at the top.

  2. #2
    Forum Expert sourabhg98's Avatar
    Join Date
    10-22-2014
    Location
    New Delhi, India
    MS-Off Ver
    Excel 2007, 2013
    Posts
    1,899

    Re: Extract Table data from web page to excel

    Hi there,
    I don't have any experience with getting data from web using macro, so I am not the right person to guide you.
    However, I am not getting any error using the above macro when I press F5. It just shows "Process Complete" in the message box. No error is shown.
    Happy to Help

    How to upload excel workbooks at this forum - http://www.excelforum.com/the-water-...his-forum.html

    "I don't get things easily, so please be precise and elaborate"

    If someone's post has helped you, thank by clicking on "Add Reputation" below the post.
    If your query is resolved please mark the thread as "Solved" from the "Thread Tools" above.

    Sourabh

  3. #3
    Valued Forum Contributor Naveed Raza's Avatar
    Join Date
    11-04-2012
    Location
    India, Hyderabad
    MS-Off Ver
    Excel, Access 2007/2010
    Posts
    1,338

    Re: Extract Table data from web page to excel

    Hi Sourab,

    thank you for looking my query,

    however it will not show any error to you, as path is taking from excel file.

    as i mention continuously, its not showing error, some time showing and some time not and sometime data capturing and sometime not.

    the reason for not capturing data is main page URL and after submitting what ever page load that URL both are same , hence sometime its capturing data from main page and sometime from after page load.

  4. #4
    Valued Forum Contributor Naveed Raza's Avatar
    Join Date
    11-04-2012
    Location
    India, Hyderabad
    MS-Off Ver
    Excel, Access 2007/2010
    Posts
    1,338

    Re: Extract Table data from web page to excel

    Hi All,

    can any one please help me out with this, how to encode this..

  5. #5
    Registered User
    Join Date
    11-28-2013
    Location
    Lima Peru
    MS-Off Ver
    Excel 2013
    Posts
    69

    Re: Extract Table data from web page to excel

    Hi Naveed, is it possible to have the URL of the web page you want to get the table from? because without the URL it is not possible to test nor debug the code.

  6. #6
    Registered User
    Join Date
    11-28-2013
    Location
    Lima Peru
    MS-Off Ver
    Excel 2013
    Posts
    69

    Re: Extract Table data from web page to excel

    OK, even without the URL i think that maybe the below code might work. Please try it and let me know if it worked or not. I am assuming that somehow you are losing handle of the IE window so the modification i have made to your program should get again a handle over the IE window. You will need a reference to the Microsoft Shell Controls and Automation library.
    Please Login or Register  to view this content.
    Last edited by EduardoHiguchi; 02-10-2016 at 07:32 PM.

  7. #7
    Valued Forum Contributor Naveed Raza's Avatar
    Join Date
    11-04-2012
    Location
    India, Hyderabad
    MS-Off Ver
    Excel, Access 2007/2010
    Posts
    1,338

    Re: Extract Table data from web page to excel

    Hi EduardoHiguchi,

    Thank you for quick response on my query, almost i spend more than 5 hours of time to get it done.

    i have test on around 5 rows of data and its works well.

    today i will test on around 600 ID's then after i will let you know...

    anyhow you have save my lot of time, i know its main page URL sometime and sometime after clicking button page and i dont know how to overcome with this and you have done it.

    Thank you So much ! , i will get back to you today EOD.....

  8. #8
    Registered User
    Join Date
    11-28-2013
    Location
    Lima Peru
    MS-Off Ver
    Excel 2013
    Posts
    69

    Re: Extract Table data from web page to excel

    Dear Mr. Naveed Raza. You are welcome and i am glad to know that i could help you a little bit. I want to ask you a favour, could you please mark the thread as solved?
    This way we will keep the moderators happy. Have a good day!

  9. #9
    Valued Forum Contributor Naveed Raza's Avatar
    Join Date
    11-04-2012
    Location
    India, Hyderabad
    MS-Off Ver
    Excel, Access 2007/2010
    Posts
    1,338

    Re: Extract Table data from web page to excel

    Hi EduardoHiguchi,

    i have test on huge rows, however sometime its closing the browser and sometime not, due to this for multiple rows its pasting same data.

    to avoid this i made small changes, i moved below line at initial and its works well thanks alot buddy...

    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)

Similar Threads

  1. Extract data from Page and subpages in Excel by vba
    By fabiosp in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 09-23-2014, 03:27 AM
  2. Search for Excel file and the sheet within that from the given table data and extract data
    By adrian_slash in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-23-2013, 07:55 AM
  3. Extract data from Excel table in PowerPoint
    By gshockxc in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-09-2013, 05:51 PM
  4. Replies: 2
    Last Post: 08-07-2013, 04:30 AM
  5. Extract Data from Powerpoint Table to Excel
    By nouri31 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-11-2013, 10:10 AM
  6. [SOLVED] Extract data from SQL Server table into excel
    By abhay_547 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-15-2010, 07:02 AM
  7. [SOLVED] Extract data (not in table) from Word to Excel
    By hellokitty77 in forum Excel General
    Replies: 1
    Last Post: 01-14-2006, 09:55 AM

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