+ Reply to Thread
Results 1 to 4 of 4

Insert multiple pictures using VBA referencing file paths

  1. #1
    Registered User
    Join Date
    08-31-2016
    Location
    Florence, Alabama
    MS-Off Ver
    Microsoft Office 365 Business 2016
    Posts
    2

    Insert multiple pictures using VBA referencing file paths

    Hello,

    I am new to both the forum and world of coding. I have multiple file path names I am trying to automate either the replacement of the paths with the photo or inserting the photo in a new column (either will suffice). The photo file paths are listed in columns C2 - C312. Does anyone know a code that will automate this for me?

    Thanks!
    Nick

  2. #2
    Forum Expert Kenneth Hobson's Avatar
    Join Date
    02-05-2007
    Location
    Tecumseh, OK
    MS-Off Ver
    Office 365, Win10Home
    Posts
    2,573

    Re: Insert multiple pictures using VBA referencing file paths

    Welcome to the forum!

    Did you want links for smaller files or full embedment? If the latter, add code below to a Module and run with the sheet active.

    Change path to files and the file extension JPG to suit.
    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    08-31-2016
    Location
    Florence, Alabama
    MS-Off Ver
    Microsoft Office 365 Business 2016
    Posts
    2

    Re: Insert multiple pictures using VBA referencing file paths

    Thanks Kenneth!

    Will this code replace all file paths in each row under the same column (C), or 1 at a time? That being said, I could not get this code to run correctly. The sheet was active and this is an example of what the code looked like once I replaced file path and JPG:


    module_1.PNG


    I know there is probably something simple I am not doing correctly but could you tell me what is wrong with the code?

    Thanks!
    Nick

  4. #4
    Forum Expert Kenneth Hobson's Avatar
    Join Date
    02-05-2007
    Location
    Tecumseh, OK
    MS-Off Ver
    Office 365, Win10Home
    Posts
    2,573

    Re: Insert multiple pictures using VBA referencing file paths

    Why did you add IMG_0097474.jpg and not use .jpg? Is that a suffix where you first cell C2 is say ken the the filename kenIMG_0097474.jpg exists in your folder?

    IF you comment out the ON ERROR link, you can see that it is probably failing because none of the filenames exist.

+ 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. Paste multiple folder/file paths into excel using VBA
    By sherlucky in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 08-24-2016, 05:01 PM
  2. How to insert > 137 no. pictures in excel file?
    By london7871 in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 07-15-2016, 05:57 AM
  3. need a vba code to insert pictures with a corresponding file name
    By whan714 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 05-19-2015, 02:50 PM
  4. Inserting Pictures using file paths
    By User3 in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 05-11-2015, 03:07 PM
  5. Insert/Delete Multiple Pictures but 1 or more pictures not available
    By MrNoodles in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-28-2012, 02:10 PM
  6. Insert Multiple pictures using VB
    By emilyf in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-25-2011, 11:38 AM
  7. 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