Hi all - i came across the following code - it helps me copy an image (picture) from my user form to a spreadsheet. I have now found that I am unable to select the picture on the sheet and cannot even delete it. My end goal is to use the user form and then transfer all the values into a spreadsheet that is set up as a printable template (including with the images)
is there a better way to do it other than with this code?
I would really like to be able to put any picture type in there... at least .png as well as .jpg. but if that isn't possible then no stress.
EDIT: i now find that I have to be in "Design Mode" to allow me to delete the image from the sheet.
is there a better way to do it other than with this code?
I would really like to be able to put any picture type in there... at least .png as well as .jpg. but if that isn't possible then no stress.
Code:
Sub imagetopcr()
Dim shapeImage As OLEObject
With Worksheets("PCR Form")
Set shapeImage = .OLEObjects.Add(ClassType:="Forms.Image.1", _
Left:=.Cells(14, "h").Top, _
Top:=.Cells(14, "h").Top, _
Width:=Me.Image1.Width, _
Height:=Me.Image1.Height)
End With
With shapeImage
.Object.PictureSizeMode = 3
.Object.Picture = Me.Image1.Picture
End With
End Sub
EDIT: i now find that I have to be in "Design Mode" to allow me to delete the image from the sheet.
Last edited: