Embedded Pictures into Image control on a Userform

al_b_cnu

Well-known Member
Joined
Jul 18, 2003
Messages
4,545
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

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.
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,215,368
Messages
6,124,520
Members
449,169
Latest member
mm424

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