+ Reply to Thread
Results 1 to 8 of 8

VBA to save URL pages

  1. #1
    Registered User
    Join Date
    11-21-2008
    Location
    New Hampshire
    Posts
    13

    VBA to save URL pages


    I have a list of URLs in Excel.
    I'm looking for a code that would tell excel to go to each URL and save it as an HTML. I don't care to much where it saves it to, the default will probably be for it to save the URLs to MY Favorites folder whic is fine, and the file name it uses is irrelevant, the dafault name is fine here too.
    Anyone know how to do this?
    Last edited by VBA Noob; 11-26-2008 at 02:19 PM.

  2. #2
    Valued Forum Contributor
    Join Date
    09-19-2008
    Location
    It varies ...
    MS-Off Ver
    Office365 - 64bit
    Posts
    862
    Others may know better than I ... but the below is as automated as I can get this:
    Please Login or Register  to view this content.
    And you have to set the reference to MS internet controls (I suggest you do this on open ... I don't know how persistant it is):
    Please Login or Register  to view this content.
    The code above is supposed to not prompt the user for a filename, but it does for some reason - anyone know why? I've also tried not making the page visible, but that just hangs.

    But hopefully it will point you in the right direction ... MM.
    Attached Files Attached Files
    Last edited by MatrixMan; 11-25-2008 at 11:13 AM. Reason: added file ..
    MatrixMan.
    --------------------------------------
    If this - or any - reply helps you, remember to say thanks by clicking on *Add Reputation.
    If your issue is now resolved, remember to mark as solved - click Thread Tools at top right of thread.

  3. #3
    Registered User
    Join Date
    11-21-2008
    Location
    New Hampshire
    Posts
    13
    Thanks, I've been trying to make it work. I have the URL's in range D2:D711. I'm having a difficult time with a compile error regarding IE Explorer being a 'User undefined'.

  4. #4
    Valued Forum Contributor
    Join Date
    09-19-2008
    Location
    It varies ...
    MS-Off Ver
    Office365 - 64bit
    Posts
    862
    You have to run the code in workbook open first ... this will set up the ie references

    And change i=1 to i=2 at the top and also the URL line at the bottom from A to D .. that will take care of your issue about the URLs being in col D.
    Last edited by MatrixMan; 11-26-2008 at 02:21 PM. Reason: additional info

  5. #5
    Registered User
    Join Date
    11-21-2008
    Location
    New Hampshire
    Posts
    13
    I'm totally screwing this up. I've got the code setup as you see below and I think this is how you meant I should do it but I'm getting a "USER DEFINED TYPE NOT DEFINED" Compile error for 'New InternetExplorer"

    Please Login or Register  to view this content.


    Please Login or Register  to view this content.
    Last edited by VBA Noob; 11-28-2008 at 12:11 PM. Reason: added code tags

  6. #6
    Valued Forum Contributor
    Join Date
    09-19-2008
    Location
    It varies ...
    MS-Off Ver
    Office365 - 64bit
    Posts
    862
    Are you running the code in workbook_open first? To do this, either:
    1. save the file as it is, then open it to activate the on open module, or
    2. copy & paste the on open code into some other (non-event) module and run it normally.

    This should set your references up and allow the 2nd lot of code to be run ... I'm assuming you're getting error when running the main code and not the smaller code? If so, the above should sort this out

  7. #7
    Registered User
    Join Date
    11-21-2008
    Location
    New Hampshire
    Posts
    13
    Just figured a large part of my problem. I have Excel 2003

  8. #8
    Valued Forum Contributor
    Join Date
    09-19-2008
    Location
    It varies ...
    MS-Off Ver
    Office365 - 64bit
    Posts
    862
    hmmm ... in that case, try something like:
    Please Login or Register  to view this content.
    Hope that helps.

+ 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