I want to insert a picture in a UserForm. However this picte is already located in a worksheet of the workbook. How can I do this?
Printable View
I want to insert a picture in a UserForm. However this picte is already located in a worksheet of the workbook. How can I do this?
Welcome to the Forums.
Is your picture an Inlineshape or an OLEObject?
You would reference which ever it is and add a Image control to your userform and set the Picture property to the referenced image.
What is the difference between an Inlineshape or an OLEObject?
I have two differente pictures I would like to insert. One is a jpg picture that is in the worksheet and the other one is a drawring I made with the drawing tools in Excel.
Did you do an Insert Image from the Insert menu or created the image/shape from the drawing oolbar? Te only difference is how we will access and reference the image.
I have both. One inserted in the worksheet using the Insert Image and one created with the drawing toolbar. And I'd like to use both images.
The one that is from the insert image is a Shape or OLEObject.
You can reference it but not the image or picture property.
VB Code:
ThisWorkbook.Sheets("Sheet1").Shapes(1)
Yes. In fact I'm able to manipulate them on the sheet. I have for example:
VB Code:
ActiveSheet.Shapes(tipogas).Visible = True
Where tipogas was a String I defined. However my issue is to be able to see an Image displayed in the UserForm. I want to put 5 different option buttons and the picture to which each option is reffered to upon the button.
Hi Fonty
i remember reading a same problem earlier so i just searched the web and finally found it ;)
Click the link below and read the solution given by Stephen Bullen.
http://groups.google.co.in/group/mic...305eb70bd975c7
Hope this helps...
Have a look at my code in the following thread for the PastePicture function. In this case it is used to copy a Chart picture to a UserFrom, but could also be used to copy any picture.
http://www.vbforums.com/showthread.php?t=402588