Linking of picture files in sheet.

honeybhattal

New Member
Joined
Jun 24, 2015
Messages
6
I have a file with a picture in it. Now, I keep this picture in the same folder as the excel file itself. I wish to know a way by which the picture automatically changes in the excel sheet, if i change the picture file in the folder. Put in other words, I want that picture(s) shown in the spreadsheet, which is/are present in the parent folder.

Any information/help is much appreciated.

Thanks in advance.
 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
Hi,

This code needs to go into the ThisWorkbook Module.

It looks for a jpg file in the same folder as the workbook then it loads it into the ActiveSheet.

Code:
Private Sub Workbook_Open()
    Dim pic As String
    pic = Dir(Path & "\*.jpg")
    If pic <> vbNullString Then ActiveSheet.Pictures.Insert (Path & "\" & pic)
End Sub
 
Upvote 0

Forum statistics

Threads
1,215,539
Messages
6,125,403
Members
449,222
Latest member
taner zz

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top