Results 1 to 3 of 3
  1. #1
    New Lounger
    Join Date
    Jan 2004
    Location
    Kansas City, Missouri, USA
    Posts
    16
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Linking to Pictures in Excel (Office 2003)

    I am trying to create an Excel file with a link to an external picture file. I want to be able to change the file contents but rename the new file with the old file name. This way (or so I think), when a user changes the original image to a different one but uses the old image name, when the worksheet opens, it should display the NEW image, not the original image.

    However, I cannot find a way to do this. If I insert an image (let's call it Image1.jpg) and save my file, then close it, and use Windows Explorer to rename Image1.jpg to Image2.jpg and then name a different file Image1.jpg, then go back and open the worksheet, the original Image1.jpg displays, not the new Image2.jpg that was RENAMED to Image1.jpg. Make sense?

    Anyway, is there any known way to make this happen?

    Thanks for your help!

  2. #2
    WS Lounge VIP sdckapr's Avatar
    Join Date
    Jul 2002
    Location
    Pittsburgh, Pennsylvania, USA
    Posts
    11,225
    Thanks
    14
    Thanked 342 Times in 335 Posts

    Re: Linking to Pictures in Excel (Office 2003)

    Are you linking to the image or embedding the image?

    If the image is embedded, it never looks at the source, it is saved in the file as the time it was copied. If you link to the image, the link will stick to that location.

    If you are embedding the picture, you could with a workbook open event, delete the current picture and add a new picture from the source whenever the file opens.

    <pre>Option Explicit
    Private Sub Workbook_Open()
    Dim sName As String
    Dim pic As Picture
    sName = "myPicture"
    With Worksheets("Sheet1")
    .Pictures(sName).Delete
    Set pic = .Pictures.Insert( _
    "Cathimage1.jpg")
    End With
    pic.Name = sName
    Set pic = Nothing
    End Sub</pre>


    Change the name of the picture, the worksheet, and the path to the file as desired.

    Steve

  3. #3
    New Lounger
    Join Date
    Jan 2004
    Location
    Kansas City, Missouri, USA
    Posts
    16
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Linking to Pictures in Excel (Office 2003)

    Thanks, Steve, for the tip. I will try it this weekend and let you know how it goes.

    I am in Phoenix this week at a conference and won't have time to try it until Friday or Saturday.

    Dick

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •