+ Reply to Thread
Results 1 to 3 of 3

Macro inserts photos but photos are lost when spreadsheet distributed

  1. #1
    Registered User
    Join Date
    08-11-2019
    Location
    Australia
    MS-Off Ver
    2016
    Posts
    1

    Macro inserts photos but photos are lost when spreadsheet distributed

    Hi there, I've got a Macro that prompts the user to select a photo and then choose the cell it gets inserted into. This part of the Macro runs fine. The issue I am having is that when the spreadsheet is opened on another computer the pictures do not load and instead a white box is in their place with an error message. I'm assuming this is because the macro is still trying to reference the file on the original computer rather than actually embedding the files into the spreadsheet. A clumsy solution I have found is to run another macro that copies and then "pastes as picture" but I'd rather avoid having to carry out this extra step. Hoping someone can guide me on how to modify the existing macro so that the photos are "embedded" (for lack of a better term).

    Here is the Macro I have:

    Please Login or Register  to view this content.
    Thanks in advance!
    Last edited by AliGW; 08-12-2019 at 02:00 AM.

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,460

    Re: Macro inserts photos but photos are lost when spreadsheet distributed

    Administrative Note:

    Welcome to the forum.

    We would very much like to help you with your query, however you need to include code tags around your code.

    Please take a moment to add the tags. Posting code between [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] tags makes your code much easier to read and copy for testing, and it also maintains VBA formatting.

    Please see Forum Rule #2 about code tags and adjust accordingly. Click on Edit to open your post, then highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here

    (Note: this change is not optional. As you are new here, I have done it for you this time.)
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Forum Guru sktneer's Avatar
    Join Date
    04-30-2011
    Location
    Kanpur, India
    MS-Off Ver
    Office 365
    Posts
    9,648

    Re: Macro inserts photos but photos are lost when spreadsheet distributed

    When you insert a picture using Pictures.Insert method, the inserted picture is linked to the source file.

    Instead you should try the Shapes.AddPicture method to save the inserted picture with the file.

    You may try something like this...

    Please Login or Register  to view this content.
    Regards
    sktneer


    Treat people the way you want to be treated. Talk to people the way you want to be talked to.
    Respect is earned NOT given.

+ 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. Is there a Macro that can insert multiple photos to a selected range of cells.
    By ebridge in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-04-2016, 04:12 PM
  2. Pasting macro photos to a new worksheet
    By whan714 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-01-2015, 12:50 PM
  3. Center photos in my macro
    By whan714 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-26-2015, 05:27 PM
  4. Insert multiple photos into excel macro
    By whan714 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-22-2015, 06:00 PM
  5. VBA Insert all Photos from folder - photos not lined up w/ cell borders in older versions
    By jaimelwilson in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-10-2014, 02:26 PM
  6. Insert multiple Photos MACRO
    By yazl in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 02-19-2014, 10:26 AM
  7. Insert Photos Macro Help
    By garrett1483 in forum Excel General
    Replies: 0
    Last Post: 07-23-2013, 03:40 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