Make a picture dynamic

Jaymond Flurrie

Well-known Member
Joined
Sep 22, 2008
Messages
921
Office Version
  1. 365
Platform
  1. Windows
I have inserted a picture into a sheet, just by using Insert -> Picture (In Excel 2007). Now I have the picture there, I have formatted it properly and it looks totally fine. It's also the only picture in the whole workbook, has name MyPicture.

How do I make it dynamic? I mean, my user decides to change the picture I used as the source picture (say, C:\pic.jpg) and I want this picture in the sheet to be linked so that it check itself from the file location, say, everytime I open the workbook.

I know how to create code that is based on events, so really, what I'm looking for is the correct property and the way to change it. Something like:

Code:
ActiveSheet.Shapes(1).FileSource = "C:\pic.jpg"
 

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.
Maybe something like

Code:
ActiveSheet.Pictures.Insert ("C:\Pictures\MyPicture.png")


-Edit-
Sorry, i misunderstood your OP
You need to assign the pic to a shape


M.
 
Last edited:
Upvote 0
Hi,

I thought you would like to assign it to a Shape, but i can't figure out (till now) how to do this.

M.

Another option is to use ActiveX component and do it like:

Code:
Sheet1.imgPicture.Picture = LoadPicture(ThisWorkbook.Path & "\MyPicture.jpg")

in the open event of workbook.

Whether I really lose something very important by using ActiveX instead of a shape, I don't know.
 
Upvote 0

Forum statistics

Threads
1,224,599
Messages
6,179,827
Members
452,946
Latest member
JoseDavid

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