+ Reply to Thread
Results 1 to 19 of 19

Return first image link from google search in excel using vba

  1. #1
    Registered User
    Join Date
    10-14-2015
    Location
    macedonia
    MS-Off Ver
    2013
    Posts
    2

    Question Return first image link from google search in excel using vba

    It is possible to modify this code to search for large images and to return the link of the first image. I tryed to modify the google link with the google image link but it doesent work
    Please Login or Register  to view this content.

  2. #2
    Forum Contributor
    Join Date
    06-24-2005
    Location
    excelliot.com
    MS-Off Ver
    2007
    Posts
    325

    Re: Return first image link from google search in excel using vba

    hi

    check this code

    Please Login or Register  to view this content.
    Cheers!!

  3. #3
    Forum Contributor
    Join Date
    06-24-2005
    Location
    excelliot.com
    MS-Off Ver
    2007
    Posts
    325

    Re: Return first image link from google search in excel using vba

    Hi,

    My earlier code was not fetching first image, use this to fetch..

    Requirements In Column A write name of object for which you want image search, In B column you will get URL of source image & in C column you will get Image matching size of your cell, you can re-size your C column to make your image bigger or smaller before running macro..

    Please Login or Register  to view this content.
    Cheers!!

  4. #4
    Registered User
    Join Date
    05-11-2016
    Location
    OTA
    MS-Off Ver
    2010
    Posts
    10

    Re: Return first image link from google search in excel using vba

    Hi everyone, thank you very much for your help! the code is great but I get an error

    I think the error is due to the format %33%A... of the fetched link: http%3A%2F%2Fweknowyourdreamz.com%2Fimages%2Fbaby%2Fbaby-02.jpg

    can you help please?

  5. #5
    Registered User
    Join Date
    06-06-2016
    Location
    USA
    MS-Off Ver
    13
    Posts
    6

    Re: Return first image link from google search in excel using vba

    Hello

    When I run excilliot's code it says Compile Error: User-defined type not defined. And it is referring to the "Dim IE as InternetExplorer"

  6. #6
    Forum Contributor
    Join Date
    06-24-2005
    Location
    excelliot.com
    MS-Off Ver
    2007
    Posts
    325

    Re: Return first image link from google search in excel using vba

    Quote Originally Posted by sawvba View Post
    Hello

    When I run excilliot's code it says Compile Error: User-defined type not defined. And it is referring to the "Dim IE as InternetExplorer"
    Hi
    ,
    You have to set a reference to the IE library for the code to work..

    Cheers!!

  7. #7
    Forum Contributor
    Join Date
    06-24-2005
    Location
    excelliot.com
    MS-Off Ver
    2007
    Posts
    325

    Re: Return first image link from google search in excel using vba

    Alternatively you can remove that line and add following one if you are not sure about howto set references:

    Please Login or Register  to view this content.
    Cheers!!

  8. #8
    Registered User
    Join Date
    07-20-2016
    Location
    USA
    MS-Off Ver
    2016
    Posts
    2

    Re: Return first image link from google search in excel using vba

    Quote Originally Posted by Vincent121 View Post
    Hi everyone, thank you very much for your help! the code is great but I get an error

    I think the error is due to the format %33%A... of the fetched link: http%3A%2F%2Fweknowyourdreamz.com%2Fimages%2Fbaby%2Fbaby-02.jpg

    can you help please?
    i get this same error. even after making sure all references are set.

  9. #9
    Forum Contributor
    Join Date
    06-24-2005
    Location
    excelliot.com
    MS-Off Ver
    2007
    Posts
    325

    Re: Return first image link from google search in excel using vba

    Quote Originally Posted by jyeldell View Post
    i get this same error. even after making sure all references are set.
    can you share exact what error you are getting..

  10. #10
    Registered User
    Join Date
    07-20-2016
    Location
    USA
    MS-Off Ver
    2016
    Posts
    2

    Re: Return first image link from google search in excel using vba

    Hello All (and thanks ExcelElliot).

    Using ExcelElliot's code as is, I received a compile error (even after making sure that all references were set).

    It would error out on the line:

    Please Login or Register  to view this content.
    After alot of digging, i discovered that the url passed to the variable "furl" was not getting fully translated into a usable url.....meaning that it contained many instances of "%2F" instead of a forward slash.

    I was able to get his code running by adding the following lines of code that further translate the resultant image URL to remove any instances of %2F:

    Please Login or Register  to view this content.

  11. #11
    Registered User
    Join Date
    08-03-2016
    Location
    korea
    MS-Off Ver
    2007
    Posts
    1

    Re: Return first image link from google search in excel using vba

    i got error with this "can't get an insert method of picture class"
    so,image doesn't come .
    what do I do for this error?
    Last edited by estone5; 08-03-2016 at 04:07 AM.

  12. #12
    Registered User
    Join Date
    10-21-2013
    Location
    london
    MS-Off Ver
    Excel 2003
    Posts
    9

    Re: Return first image link from google search in excel using vba

    Hi, could anybody assist, i am adding Exelliots code above and i get runtime error 5 , invalid procedure call when i run the code?

    when i add values to Column A nothing is happening

    Any help would be great! Thanks

  13. #13
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,926

    Re: Return first image link from google search in excel using vba

    thegr812k welcome to the forum

    Unfortunately your post does not comply with Rule 2 of our Forum RULES. Do not post a question in the thread of another member -- start your own thread.

    If you feel an existing thread is particularly relevant to your need, provide a link to the other thread in your new thread.

    Old threads are often only monitored by the original participants. New threads not only open you up to all possible participants again, they typically get faster response, too.
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  14. #14
    Registered User
    Join Date
    03-04-2021
    Location
    Dubai, UAE
    MS-Off Ver
    OFFICE 365
    Posts
    2

    Re: Return first image link from google search in excel using vba

    im getting the same error.
    Any help would be great!

  15. #15
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,926

    Re: Return first image link from google search in excel using vba

    Quote Originally Posted by cjain_560 View Post
    im getting the same error.
    Any help would be great!
    Did you really not see the post IMMEDIATELY above yours (the very past post you would see as you type your post???

  16. #16
    Registered User
    Join Date
    03-04-2021
    Location
    Dubai, UAE
    MS-Off Ver
    OFFICE 365
    Posts
    2
    Quote Originally Posted by FDibbins View Post
    Did you really not see the post IMMEDIATELY above yours (the very past post you would see as you type your post???
    Do you really see me asking a question there ? Don’t be a smart one, if you can help, so be it, otherwise let others reply.

  17. #17
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,926

    Re: Return first image link from google search in excel using vba

    wind your neck in, newbie! You posted a question phrased as a statement. If you want an answer, open your own thread - and take a few minutes to read our rules.

  18. #18
    Registered User
    Join Date
    09-20-2022
    Location
    new york
    MS-Off Ver
    365
    Posts
    2

    Re: Return first image link from google search in excel using vba

    little lost getting a not declared error, anyone have a working workbook to follow?

  19. #19
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,926

    Re: Return first image link from google search in excel using vba

    Quote Originally Posted by pborreronyc View Post
    little lost getting a not declared error, anyone have a working workbook to follow?
    Administrative Note:

    Welcome to the forum.

    We are happy to help, however whilst you feel your request is similar to this thread, experience has shown that things soon get confusing when answers refer to particular cells/ranges/sheets which are unique to your post and not relevant to the original.

    Please see Forum Rule #4 about hijacking and start a new thread for your query.

    If you are not familiar with how to start a new thread see the FAQ: How to start a new thread

+ 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. Autoimport Google Image Search Result into Excel
    By awesummusik in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-14-2021, 12:29 PM
  2. Google image search from cell contents of excel file
    By merQrey in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 07-24-2020, 01:01 AM
  3. Replies: 0
    Last Post: 07-08-2014, 06:27 AM
  4. Macro NEED Remake- search in google and copy link
    By kunmateo93 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-06-2014, 12:19 PM
  5. [SOLVED] Google search link of text in Column A help?
    By brianroe88 in forum Excel General
    Replies: 13
    Last Post: 09-24-2013, 01:12 PM
  6. Replies: 0
    Last Post: 11-05-2009, 04:47 AM

Tags for this Thread

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