+ Reply to Thread
Results 1 to 15 of 15

Macro to return JPG image from URL (2 URL's in an IF statement determined by dimensions

  1. #1
    Registered User
    Join Date
    11-16-2012
    Location
    St. Louis, MO
    MS-Off Ver
    Excel 2007
    Posts
    10

    Macro to return JPG image from URL (2 URL's in an IF statement determined by dimensions

    Hi all,

    Second post on forum, hope to have more luck with this one....need some help with this one.

    I have a macro that retrieves images from the web. It is set up in an IF loop to look at one image server, if it finds an image, it returns it, if not it checks an older (far less up to date) image server. The problem I am having is the newer image server (accurate pictures) displays a picture of the words "image not available", so it thinks it has found the image. Therefor it never completes the if loop to check the second server. I need a way to edit the attached macro to look at the URL JPG file dimensions. when there is an image, it is 350x350, the image not available is 325x325. Here are 2 links to demonstrate the image servers. Both are for Item 00059 based on a sales spreadsheet.

    No image available:
    http://www.famousfootwear.com/produc...es_ib00059.jpg

    Correct Image:
    http://www.famousfootwear.com/produc...ff_ib00059.jpg


    Running Excel 2007

    In this case, the if loop never gets past the "shoes" server to the correct image on the "ff" server. The simple answer would be to reverse the order in the if loop, but the "ff" server has so many bad (outdated) images that it has at least a 25% error rate. In my opinion, no image is better than the wrong one.

    I really need help with this one...the VP in my group wants this corrected asap. I can attach the spreadsheet or email it to anyone who is willing and able to help.






    Here is a look at my code:


    Please Login or Register  to view this content.
    Last edited by Leith Ross; 02-26-2013 at 04:29 PM. Reason: Added Code Tags

  2. #2
    Valued Forum Contributor xlbiznes's Avatar
    Join Date
    02-22-2013
    Location
    Bahrain
    MS-Off Ver
    Excel 2007
    Posts
    1,223

    Re: Macro to return JPG image from URL (2 URL's in an IF statement determined by dimension

    Hi,

    Please upload your file , in order to offer you a proper solution.
    Happy Computing ,

    Xlbiznes.

    To show your appreciation please click *

  3. #3
    Registered User
    Join Date
    11-16-2012
    Location
    St. Louis, MO
    MS-Off Ver
    Excel 2007
    Posts
    10

    Re: Macro to return JPG image from URL (2 URL's in an IF statement determined by dimension

    Hi Xlbiznes, thanks for taking the time to take a look....working to attach the file...having size issues

  4. #4
    Registered User
    Join Date
    11-16-2012
    Location
    St. Louis, MO
    MS-Off Ver
    Excel 2007
    Posts
    10

    Re: Macro to return JPG image from URL (2 URL's in an IF statement determined by dimension

    So, I had to cut it down pretty badly. There is only data for department M and Total (blank department data) in the data now, but it fit!

    Thanks to all for the help!!!
    Attached Files Attached Files

  5. #5
    Valued Forum Contributor xlbiznes's Avatar
    Join Date
    02-22-2013
    Location
    Bahrain
    MS-Off Ver
    Excel 2007
    Posts
    1,223

    Re: Macro to return JPG image from URL (2 URL's in an IF statement determined by dimension

    Hi,

    Please see the code that i have added to your insert picture function to check for the no image file. Hope this helps.

    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    11-16-2012
    Location
    St. Louis, MO
    MS-Off Ver
    Excel 2007
    Posts
    10

    Re: Macro to return JPG image from URL (2 URL's in an IF statement determined by dimension

    Xlbiznes, This is not working for me.....I dropped in msgboxes along the new code and it looks to be running the delete steps, the starting to fill, but comes back with no images. Im sure it something I'm doing wrong. Any Thoughts?

  7. #7
    Registered User
    Join Date
    11-16-2012
    Location
    St. Louis, MO
    MS-Off Ver
    Excel 2007
    Posts
    10

    Re: Macro to return JPG image from URL (2 URL's in an IF statement determined by dimension

    also, if it matters, I have Excel 2007, with SP 1.

  8. #8
    Valued Forum Contributor xlbiznes's Avatar
    Join Date
    02-22-2013
    Location
    Bahrain
    MS-Off Ver
    Excel 2007
    Posts
    1,223

    Re: Macro to return JPG image from URL (2 URL's in an IF statement determined by dimension

    Mine is Excel 2007 (SP 2).

    In the template that you are displaying the images , I do not see any "No Image" image. All the products are displayed.

    Can you give me some data to simulate the no image problem.

  9. #9
    Registered User
    Join Date
    11-16-2012
    Location
    St. Louis, MO
    MS-Off Ver
    Excel 2007
    Posts
    10

    Re: Macro to return JPG image from URL (2 URL's in an IF statement determined by dimension

    On the original file, go to the RED sheet called "User Select". At the top left there are yellow boxes, left of the one Marked "Department", enter or pick "M" from the drop down menu. This will recalc the items for the Mens department top selling items. Then run the macro by clicking the RED arrow at the top called "Insert Photos". Item ranked #10 is 72681, #11 is 15888.

    once the macro has run, these are displaying the "no image available" image, not the picture from the FF image server

    Hope this helps to show you examples....if you need more, let me know

    Thanks a TON!

  10. #10
    Valued Forum Contributor xlbiznes's Avatar
    Join Date
    02-22-2013
    Location
    Bahrain
    MS-Off Ver
    Excel 2007
    Posts
    1,223

    Re: Macro to return JPG image from URL (2 URL's in an IF statement determined by dimension

    I just ran the template with my code and i have none of items showing the "No Image".

  11. #11
    Valued Forum Contributor xlbiznes's Avatar
    Join Date
    02-22-2013
    Location
    Bahrain
    MS-Off Ver
    Excel 2007
    Posts
    1,223

    Re: Macro to return JPG image from URL (2 URL's in an IF statement determined by dimension

    Have a look at the images for M department.
    Attached Files Attached Files

  12. #12
    Registered User
    Join Date
    11-16-2012
    Location
    St. Louis, MO
    MS-Off Ver
    Excel 2007
    Posts
    10

    Re: Macro to return JPG image from URL (2 URL's in an IF statement determined by dimension

    your attached file looks perfect, exactly what I need. When I run it, with your code, I am getting no images at all, not a picture of a shoe or the No image available picture.

    What version of excel do you have?

  13. #13
    Valued Forum Contributor xlbiznes's Avatar
    Join Date
    02-22-2013
    Location
    Bahrain
    MS-Off Ver
    Excel 2007
    Posts
    1,223

    Re: Macro to return JPG image from URL (2 URL's in an IF statement determined by dimension

    Mine is excel 2007 ( sp2). Did you create the "temp" sheet in your workbook ?

  14. #14
    Registered User
    Join Date
    11-16-2012
    Location
    St. Louis, MO
    MS-Off Ver
    Excel 2007
    Posts
    10

    Re: Macro to return JPG image from URL (2 URL's in an IF statement determined by dimension

    YOU ARE AWESOME!!!!!

    I found a PC in my office that has SP2, worked perfectly!!!!

    Now, to try to convince my IT dept to push out the patch.

    Thanks again for your help.

  15. #15
    Valued Forum Contributor xlbiznes's Avatar
    Join Date
    02-22-2013
    Location
    Bahrain
    MS-Off Ver
    Excel 2007
    Posts
    1,223

    Re: Macro to return JPG image from URL (2 URL's in an IF statement determined by dimension

    Glad i could help.

    I hope your VP appreciates your efforts to get this resolved.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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