+ Reply to Thread
Results 1 to 8 of 8

Getting dynamic data

  1. #1
    Registered User
    Join Date
    09-02-2010
    Location
    China
    MS-Off Ver
    Excel 2003
    Posts
    4

    Getting dynamic data

    I have a situation, where i have to open a webpage (.jsp), input current date , select one check box and submit the form.
    After submitting, i get lots of records along with other infomation in table form (with paging). The number of pages depends on the total varies.
    Each record has a hyperlink, on clicking hyperlink one pop up window opens and i have to copy some data from the window and paste to excel file.
    I have to do this for all the records.
    So far i have managed to autofill the current date & select the check box and submit the form.
    I would like to know how can i do this for all records and automate this process?
    Also when the records are returned there is no detail of how many pages are there. example (1 of 15..)
    Below is the code which i have managed to write so far...im not expert in VBA.
    Please Login or Register  to view this content.

  2. #2
    Registered User
    Join Date
    09-02-2010
    Location
    China
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: Getting dynamic data to excel 2007

    any idea about this? can this be done?

  3. #3
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,169

    Re: Getting dynamic data to excel 2007

    I get an error on the line:

    Please Login or Register  to view this content.
    Do you get past this spot in your code?

  4. #4
    Forum Contributor
    Join Date
    07-13-2007
    Posts
    151

    Re: Getting dynamic data to excel 2007

    I filled in the ** in your code with c d as one of the valid options in the main form's source.

    Put the code below into a SHEET MODULE in your workbook. It will cycle through each link and give you the opportunity to pull what you want from each Pop Up window.

    You'll need to make References to the 2 libraries indicated in the comment lines. for it to work, as it uses Early Binding.

    Hope that Helps...

    Shred

    ** - This is Bizarre! If I type the letters c & d together, anywhere in the post, it appears as ** !!??

    Please Login or Register  to view this content.
    Last edited by ShredDude; 09-05-2010 at 01:48 PM. Reason: Needed an exit from page loop

  5. #5
    Registered User
    Join Date
    09-02-2010
    Location
    China
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: Getting dynamic data to excel 2007

    this code is great. thanks shredDude. just one more help, could u also pls give me some sample code to grab data from popup window n copy to sheet1? Any one field from popup window is ok. Thank you

  6. #6
    Forum Contributor
    Join Date
    07-13-2007
    Posts
    151

    Re: Getting dynamic data to excel 2007

    The HTML Source for the Pop Up is not very well formed, IMO. Your data is in a table format like this:

    HTML Code: 
    So, I'd recommend grabbing the table and looping through the rows/cells that you desire. To get a feel for what data is where, insert sometihing like this in the section where you have the reference to the pop up

    Please Login or Register  to view this content.
    That'll give you a feel for what data is where. Then once you know what you want, just identify each piece accordingly and assign to where ever you want to put it.

  7. #7
    Registered User
    Join Date
    09-02-2010
    Location
    China
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: Getting dynamic data to excel 2007

    perfect...thanks a lot.

  8. #8
    Forum Contributor
    Join Date
    07-13-2007
    Posts
    151

    Smile Re: Getting dynamic data to excel 2007

    I answered your question with the approach you were suggesting. However, after reviewing the site, I'd probably approach it another way.

    I'd probably use Internet Explorer to get the Original links, but then use a faster method to retrieve the data from each one.


    The code below accomplishes this. It is very fast compared to the other method.

    I haven't tested it with other input criteria as I can't read the options. You may want to determine the structure of the URL used when you have different input criteria on the first form. for the test input you've provided, it work well.

    try it out...

    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