Picture in a worksheet

nadiminti

Board Regular
Joined
Dec 20, 2004
Messages
113
I have loaded several pictures in a worksheet "Pictures"

The pictures are inserted in the worksheet by simple copy paste.

On a userform, I am trying to load the picture by using this code

<code>
Private Sub UserForm_Initialize()
Image2.Picture = Worksheets("Pictures").OLEObjects("Picture 1").Object.Picture
End Sub
</code>

It is not loading and giving error.

Please help on how could I do it.
 

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.
I'm looking for VBA code which can take the picture from one of the existing sheets. If I have to load from a location, then I need to copy the image directory along with the .xlsm file.
 
Upvote 0
Thank you Jaafar, but you are ultimately loading it from the HD. All my images are already on the worksheet.
 
Upvote 0
No.. You just copy the image on the worksheet to the clipboard and then extract the picture from the clipboard and load it into the userform control ... No need to save the picture to disk
 
Last edited:
Upvote 0
Hmm.. could you provide me the code please... in your link it is some thing related to your case. For my problem, what would be the code?
 
Upvote 0

Forum statistics

Threads
1,214,985
Messages
6,122,606
Members
449,089
Latest member
Motoracer88

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