+ Reply to Thread
Results 1 to 3 of 3

Exporting from web page via VBA

  1. #1
    Registered User
    Join Date
    12-31-2012
    Location
    Colorado
    MS-Off Ver
    Excel 2007
    Posts
    2

    Exporting from web page via VBA

    Hey guys, I'm needing help exporting a data table from a web page through VBA code. I'm trying to basically automate data pull (and formatting after its been pulled) but I cant seem to get it to work from the various examples I've been looking at online. I've gotten as far as to get the page to open, using the "While IE.ReadyState < 4" to keep it from progressing through the code while the page is loading (as some loads can take a min or two).


    Please Login or Register  to view this content.
    This is what i have so far with the VBA. I need to now add code to go to an "Export to" dropdown and then click an "Excel" link from it. Furthermore I will need it to click an "OK" button on a child window that pulls up (it defaults to the "XLS" option which is fine as is).

    I've attached pics of what the menu/button structure looks like on the web page itself. Thanks in advance for any assistance.
    Attached Files Attached Files

  2. #2
    Forum Contributor
    Join Date
    04-03-2011
    Location
    India
    MS-Off Ver
    Excel 2015
    Posts
    122

    Re: Exporting from web page via VBA

    The site is not working ... please check and revert

  3. #3
    Registered User
    Join Date
    12-31-2012
    Location
    Colorado
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: Exporting from web page via VBA

    Its probably the content is protected which is why i just included the screenshots to get a general idea out of what Im working with.

    Good news, I've stumbled across the solution to call upon the function on the webpage to begin the export process. My next hurdles are the open/save/close window that pops up for the export. I'm needing it to just open the window so the macro can copy data out of it then close that newly opened file. Furthermore another window pops up is titled "Microsoft Office Excel" and the window reads: "The file you are trying to open, 'Name.xls', is in a different format than specified by the file extension. Verify that the file is not corrupted and is from a trusted source before opening the file. Do you want to open the file now?" options yes/no/help in which i want it to select "Yes".

    Any ideas on how to write it into the vba to select those options accordingly?

    if its something that can be appended to the code that I've written to open the export by running the function from the web page the line im using to do that is as follows:

    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