+ Reply to Thread
Results 1 to 14 of 14

Inserting Pictures using file paths

  1. #1
    Registered User
    Join Date
    09-29-2007
    Location
    Lahore, Pakistan
    MS-Off Ver
    2007, 2010
    Posts
    51

    Inserting Pictures using file paths

    Hi All,

    I have student ID's in column B, file path of students' pictures in column C. I want to show the picture of student in column J. Picture name is same as student ID in column B (e.g if student ID is 1005, it's picture name is also 1005 in specified folder). I also want to set picture size equal to the size of cell in column J.

    I have search the web and tried many solutions but could not get the right way.
    I hope here the gurus can solve it.

    Regards.

  2. #2
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Inserting Pictures using file paths

    Attach a sample workbook. Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and use the paperclip icon to open the upload window.

    View Pic
    If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)

    You can't do one thing. XLAdept

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin

  3. #3
    Registered User
    Join Date
    09-29-2007
    Location
    Lahore, Pakistan
    MS-Off Ver
    2007, 2010
    Posts
    51

    Re: Inserting Pictures using file paths

    File is attached and requirement is explained in that file.

    Thank you for your time and effort.
    Attached Files Attached Files

  4. #4
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Inserting Pictures using file paths

    Hi User3,

    Try this:

    Please Login or Register  to view this content.
    Last edited by xladept; 05-05-2015 at 03:36 PM.

  5. #5
    Registered User
    Join Date
    09-29-2007
    Location
    Lahore, Pakistan
    MS-Off Ver
    2007, 2010
    Posts
    51

    Re: Inserting Pictures using file paths

    Hi xladept,

    I have applied this code and it give error msg "400". Can you please apply it in file and see if it works.
    Thank you.

  6. #6
    Registered User
    Join Date
    09-29-2007
    Location
    Lahore, Pakistan
    MS-Off Ver
    2007, 2010
    Posts
    51

    Re: Inserting Pictures using file paths

    I have also found a code from searching internet, can u see what amendments could be made to apply this in my workbook. Cell and column references are also to be adjusted.


    Please Login or Register  to view this content.

  7. #7
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Inserting Pictures using file paths

    I made a small change and it works on a png image for me:

    Please Login or Register  to view this content.

  8. #8
    Registered User
    Join Date
    09-29-2007
    Location
    Lahore, Pakistan
    MS-Off Ver
    2007, 2010
    Posts
    51

    Re: Inserting Pictures using file paths

    Quote Originally Posted by xladept View Post
    I made a small change and it works on a png image for me:

    Please Login or Register  to view this content.
    Hi xladept
    I have tried this code. It inserts first pic in cell Y5 so many times and leave other cells below blank. It also makes my file busy as something is still in process and in few seconds Excel title bar shows "Not responding", so I have to forcibly close it.
    What's the matter in it? Can you please resolve it.
    I have attached the file after running the code you can see by dragging the pic that cell Y5 has so many same pics and below cells are empty.

    Code should see the ID's available in col D and should insert only as many number of pics as many ID's are available in col D to consume less time. Please make one more amendment that code could work for all types of images not only PNG because some pics do not have PNG format in specific folder.

    Thank you for your time and effort you are putting for me.
    Regards
    Attached Files Attached Files
    Last edited by User3; 05-07-2015 at 02:40 AM.

  9. #9
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Inserting Pictures using file paths

    Oops! My Bad - I forgot to increment the index - sorry:

    Please Login or Register  to view this content.

  10. #10
    Registered User
    Join Date
    09-29-2007
    Location
    Lahore, Pakistan
    MS-Off Ver
    2007, 2010
    Posts
    51

    Re: Inserting Pictures using file paths

    Hi xladept,

    This code is working nicely. Only one problem is there that it gives error "400" when one or more pics are missing in relevant folder. Please make amendments so that it could ignore the missing pics and insert only available pics.

    One more thing when code is executed it should first remove previous pics from cells and then insert new ones because I have to change the list of ID's again and again and need the code to insert new pics.

    Thank you for your work for me.
    Last edited by User3; 05-08-2015 at 06:34 AM.

  11. #11
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Inserting Pictures using file paths

    I'll look at it again tomorrow

    For some reason, I only saw this post after you PM'd me

  12. #12
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Inserting Pictures using file paths

    Try this:

    Please Login or Register  to view this content.

  13. #13
    Registered User
    Join Date
    09-29-2007
    Location
    Lahore, Pakistan
    MS-Off Ver
    2007, 2010
    Posts
    51

    Re: Inserting Pictures using file paths

    Thank you xladept,

    Matter is resolved... I'll in touch through this post if any problem arises.

    Thank you again for your work.
    Excel tips @
    www.fb.com/businessexcel

  14. #14
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Inserting Pictures using file paths

    You're welcome and thanks for both the rep and the compliment!

+ 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. Inserting pictures from file
    By rougefish in forum Excel - New Users/Basics
    Replies: 5
    Last Post: 09-22-2014, 06:05 AM
  2. Export To Inf file & Zip the Files from the given file paths picking every 10 rows
    By vivekhalder in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-18-2012, 03:59 AM
  3. inserting more than 65536 pictures into file using VBA
    By maple3 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 04-29-2006, 08:10 PM
  4. Inserting pictures in a CHM file
    By Fred Russell in forum Excel General
    Replies: 2
    Last Post: 01-10-2006, 02:15 PM
  5. converting paths to pictures
    By [email protected] in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 10-08-2005, 10:05 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