+ Reply to Thread
Results 1 to 9 of 9

VBA macro sometimes doesn't download images

  1. #1
    Registered User
    Join Date
    04-24-2017
    Location
    Portugal
    MS-Off Ver
    2016
    Posts
    27

    VBA macro sometimes doesn't download images

    Hello everyone!

    I have this VBA code that I use to download the first image from google, from a cell that contains search keywords.
    Problem is, most of the times it does not download all images and some times duplicates, expecially in the end.

    Can you guys kindly see my code and iluminate me with some ideas to solve this issue?

    Thank you in advance!

    Please Login or Register  to view this content.

  2. #2
    Registered User
    Join Date
    04-24-2017
    Location
    Portugal
    MS-Off Ver
    2016
    Posts
    27

    Re: VBA macro sometimes doesn't download images

    Did anyone had a change to take a look? I'm still trying to fix this.

    Yesterday I tried to use a timeout function but didn't work, or I didnt apply it well.

    If someone has any news please let me know.

  3. #3
    Forum Expert
    Join Date
    04-01-2013
    Location
    East Auckland
    MS-Off Ver
    Excel 365
    Posts
    1,343

    Re: VBA macro sometimes doesn't download images

    you should mention you need microsoft internet controls and microsoft html object library

    and include whatever this function is

    URLDecode()

    if it downloads duplicates I guess it errors and " On Error Resume Next" is hiding that error. try seeing where it fails with out that.
    You may want to reset your variables at the end of each loop.
    If you want something done right... find a forum and ask an online expert.

    Time flies like an arrow. Fruit flies like a banana.

  4. #4
    Registered User
    Join Date
    04-24-2017
    Location
    Portugal
    MS-Off Ver
    2016
    Posts
    27

    Re: VBA macro sometimes doesn't download images

    I have the correct references.
    The "On Error Resume Next" Is for, when excel doesnt find anything in google and cannot retrieve any links to register. In this way instead of stoping the code running, it continues.
    Excel doesnt seem to handle the time out of internet explorer.
    I still have no solution for this problem.
    Last edited by ExNub; 06-25-2019 at 01:14 PM.

  5. #5
    Registered User
    Join Date
    04-24-2017
    Location
    Portugal
    MS-Off Ver
    2016
    Posts
    27

    Re: VBA macro sometimes doesn't download images

    I have tried other fixes. Without Success.
    I re-writed the code and tried other things, so excel can have a good timing to download the fotos but didn't work.
    Anyone had a chance to have a look?

  6. #6
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Question

    Hi !

    Quote Originally Posted by ExNub View Post
    I re-writed the code
    Should we guess what is your last code ?!

    Maybe you can try another web search engine …

  7. #7
    Registered User
    Join Date
    04-24-2017
    Location
    Portugal
    MS-Off Ver
    2016
    Posts
    27

    Re: VBA macro sometimes doesn't download images

    Quote Originally Posted by Marc L View Post
    Hi !

    Should we guess what is your last code ?!

    Maybe you can try another web search engine …
    The re-write ended up with the same results of the original that I provided.

    The google engine is the most reliable for what I need. Considering that I already prospected other engines.

    I understand this ain't a everyday easy problem to solve, so, I would glady accept realistic solutions.

  8. #8
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Re: VBA macro sometimes doesn't download images


    As the Google engine is the one I met with most issues for this kind of need,
    as it seems you have optimized your initial code so I won't waste any time to recreate
    what you yet have done without seeing your last code, as …
    Then all I can say is to apply a web search for your need.
    Or maybe restart from a well known Google result for only an unique cell (so without a loop for a range)
    in order to test at least if your code well works of course without On Error Resume Next …
    Once it well works, search another cell when it fails in order to compare each Google webpage code.

  9. #9
    Registered User
    Join Date
    04-24-2017
    Location
    Portugal
    MS-Off Ver
    2016
    Posts
    27

    Re: VBA macro sometimes doesn't download images

    Ok, I understand your logic, thank your for sharing, I will try what you sugested.

+ 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. [SOLVED] Download images
    By Beermonster in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 03-27-2024, 08:52 AM
  2. Download images from URL list
    By Galliass in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-12-2017, 03:49 AM
  3. VBA to download images in web
    By plakatax in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-05-2016, 04:05 AM
  4. vba to download all images from facebook
    By raj soni in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-18-2015, 08:09 AM
  5. code to download images from google images
    By yousuf_seifi in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-19-2015, 11:46 PM
  6. Macro to download Images from URL Help
    By ryanb4614 in forum Excel General
    Replies: 1
    Last Post: 07-25-2012, 07:08 AM
  7. [SOLVED] Bulk Download Images
    By ryanj4314 in forum The Water Cooler
    Replies: 1
    Last Post: 07-09-2010, 03:55 PM

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