Load a picture to a userform from a picture in a spreadsheet

rory

New Member
Joined
May 5, 2004
Messages
2
Hi, can anyone help.

I have a group of charts and pictures on a spreadsheet

I have a userform that uses the loadpicture function to load the charts successfully into an image on the userform. (There are lots of examples around as to how to do this).
However I am struggling to find the same in terms of simply loading the embedded pictures into the image on the userform. All the examples I have refer to pictures stored on drives e,g. loadpicture(C:= / / /.gif). I am looking for loadpicture(thisworksheet.sheets("sheetname").???
can anyone help.
Thanks,
Rory
 

Some videos you may like

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).

NdNoviceHlp

Well-known Member
Joined
Nov 9, 2002
Messages
2,723
Hi Rory. Is it this easy? Dave
Code:
UserForm1.Image1.Picture = Sheets("Sheet1").Image1.Picture
 

Ivan F Moala

MrExcel MVP
Joined
Feb 10, 2002
Messages
4,209
You may need to also throw in a Repaint to refresh the userform

eg as NdNoviceHlp has given THEN

Me.Repaint
 

NdNoviceHlp

Well-known Member
Joined
Nov 9, 2002
Messages
2,723
Thanks Ivan. I didn't mention it, but in order for the above code to work more than once you need to clear the image control first. Me.Repaint I did not know. Is it the same as clearing the image previous? The word "Repaint" seems to imply layers. Are previous images available? Dave
 

msvec

Board Regular
Joined
Feb 18, 2002
Messages
202
This wasn't so easy for me. This has been driving me crazy and then i stumbled across this thread and was very happy, but i can't get it to work. FYI:

I have a picture name "Mike" in a spreadsheet and userform info as follows, but keep getting Object doesn't support this method or property...

tried the following w/ no luck:

frmProp.propImage.Picture = ActiveSheet.Pictures("Mike")frmProp.propImage.Picture = Sheets("Report").Pictures("Mike")
frmProp.propImage.Picture = Sheets("Report").Shapes("Mike")

even tried
frmProp.propImage.Picture = Sheets("Report").Shapes("Mike").Picture

i know this is possible, just cant get the syntax...any help would be wonderful...

thx
 

Watch MrExcel Video

Forum statistics

Threads
1,122,514
Messages
5,596,612
Members
414,080
Latest member
penguin23

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
Top