Embedded Pictures into Image control on a Userform

al_b_cnu

Well-known Member
Joined
Jul 18, 2003
Messages
4,546
Hi,

I am writing an app, and would like to include some online help. The help needs to have screenshots, so have embedded these screenshots (named 'Pic1' , 'Pic2', ... Picn') into a hidden worksheet, and would like to selectively display them in an image control in a userform.

I also have a column (say column A) which has the names of the embedded pictures as text.

Searching the board seems to suggest using 'LoadPicture', but this will only load the images from an external file.

Any suggestions please?

Many thanks

Alan
 

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).
Cracked it!

Inserted pictures on s/sheet via Image control, then used this example code (which just displays the 1st image):


Code:
Private Sub UserForm_Activate()
Dim imgList As ImageList

Set imgList = New ImageList

imgList.ListImages.Clear
imgList.ListImages.Add Key:="img1", Picture:=Sheet1.OLEObjects("Pic1").Object.Picture
imgList.ListImages.Add Key:="img2", Picture:=Sheet1.OLEObjects("Pic2").Object.Picture

Set Image1.Picture = imgList.ListImages.Item("img1").Picture
End Sub
 
Upvote 0

Forum statistics

Threads
1,224,802
Messages
6,181,054
Members
453,014
Latest member
Chris258

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