+ Reply to Thread
Results 1 to 5 of 5

saving imported picture in excel using vba

  1. #1
    Registered User
    Join Date
    02-12-2013
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    68

    saving imported picture in excel using vba

    hi everyone, I'm doing a project in vba that involves uploading different users profile images into there particular record in a spreadsheet, via a excel vba form. does anyone know how to import pictures and save them to the excel file using vba?

    thank you!

  2. #2
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    Re: saving imported picture in excel using vba

    Is this something you can use?

    The below code
    • loops through each cell in the selected range
    • reads the filepath from that cell
    • inserts the referenced picture in the cell to the right of the cell:
    • resizes the height and width of the picture to the cell's height

    Please Login or Register  to view this content.
    Ron
    Former Microsoft MVP - Excel (2006 - 2015)
    Click here to see the Forum Rules

  3. #3
    Registered User
    Join Date
    02-12-2013
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    68

    Re: saving imported picture in excel using vba

    thanks for your help! is it possible to add this code to other code that will display a file picker too allow a user to select an image?

  4. #4
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    Re: saving imported picture in excel using vba

    You could have the date picker set a file location variable and pass that variable and the destination cell to the procedure.

    Perhaps something like this (Untested)

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    02-12-2013
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    68

    Re: saving imported picture in excel using vba

    is something like this what you mean? or...
    Please Login or Register  to view this content.

+ 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. Saving imported files
    By Gary Evans in forum Excel General
    Replies: 1
    Last Post: 03-21-2012, 03:45 AM
  2. Automatically Resize Imported Picture to Fit Cells
    By k11ngy in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-23-2011, 10:46 AM
  3. Saving a chart as picture
    By retawol in forum Excel Charting & Pivots
    Replies: 4
    Last Post: 11-20-2006, 05:38 PM
  4. Imported Picture Pastes randomly.
    By texx2000 in forum Excel General
    Replies: 4
    Last Post: 11-03-2006, 10:14 AM
  5. Keeping Imported Picture in Cell During Sort
    By Big John Aggie in forum Excel General
    Replies: 0
    Last Post: 01-11-2006, 04:50 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