Closed Thread
Results 1 to 8 of 8

loop through a list of links and download files.

  1. #1
    abhay_547
    Guest

    loop through a list of links and download files.

    Hi All,

    I have the below function which helps me to download the files from a URL. Now I have a file where I have List of download links in column A and New File name in Column B and extension in Column C. I want to loop through the rows and download the files from the links present in column A and while saving the files use the new file name which is column b and extension present in column C.

    Please Login or Register  to view this content.
    I tried something like below but it's not working.

    Please Login or Register  to view this content.
    Please help..

    Thanks a lot for your help in advance.

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: loop through a list of links and download files.

    Assuming your first function actually works, then the second one would need a reference to the full range of values on your sheet:

    Please Login or Register  to view this content.
    Last edited by JBeaucaire; 11-06-2010 at 02:56 PM.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    abhay_547
    Guest

    Re: loop through a list of links and download files.

    Hi JBeaucaire,

    Thanks a lot for your reply, the code posted by you is not working. It gets stuck on the below code and shows a syntax error. Please help..


    Please Login or Register  to view this content.
    I have attached my macro file as well for your reference.

    Thanks a lot for your help in advance.
    Attached Files Attached Files

  4. #4
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: loop through a list of links and download files.

    Looking at your data, I would offer this correction to my code:
    Please Login or Register  to view this content.


    But i did stipulate, your DownloadFilefromWeb function has to actually work. Has it ever worked for you? Even for one file?

    I ran the code just now and it downloaded several files.
    Last edited by JBeaucaire; 11-06-2010 at 02:53 PM.

  5. #5
    abhay_547
    Guest

    Re: loop through a list of links and download files.

    Hi JBeaucaire,


    Thanks a lot for your reply, now it's working fine. It downloads the files as far as your question is concerned it use to download the files earlier as well. The only thing is that as soon as I run the macro it shows some error popup message but once I click ok it starts downloading files. Even now I am facing the same issue. not sure how to fix the same.

    Thanks a lot for your help.

  6. #6
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: loop through a list of links and download files.

    It's the value in cell A1 that's causing the error message. We can change the RNG declaration to skip that first row.

    Please Login or Register  to view this content.
    Last edited by JBeaucaire; 11-06-2010 at 03:40 PM.

  7. #7
    abhay_547
    Guest

    Re: loop through a list of links and download files.

    Hi JBeaucaire,

    Thanks a lot for your reply, But now it's showing a "Out of memory" error and when i debug it highlights the below code line. Not sure what is going wrong and what could be the reason everything looks fine.

    Please Login or Register  to view this content.
    Thanks a lot for your help in advance.

  8. #8
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: loop through a list of links and download files.

    Should be Rows.Count (notice the period?)

    Please Login or Register  to view this content.

Closed 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