Hello,
I have an Userform that when you click on a button named Photo it opens Windows Camera App and when your finished taking photos (you close the App). You then click on another button on the Userform that should load the mostrecentfile into a Image Control (the code is still a bit wonky on this particular aspect, but I am getting there).
Once the image is loaded in the Image Control I want to place it directly from the Image Control on a specific range on Sheet1. The thing is I am uncertain if this is possible? I have written the code and kept it simple, but I get an Error 1004: Specified value out of range. The error is in the line in red.
Is this possible?
Can someone please help me?
Regards,
I have an Userform that when you click on a button named Photo it opens Windows Camera App and when your finished taking photos (you close the App). You then click on another button on the Userform that should load the mostrecentfile into a Image Control (the code is still a bit wonky on this particular aspect, but I am getting there).
Once the image is loaded in the Image Control I want to place it directly from the Image Control on a specific range on Sheet1. The thing is I am uncertain if this is possible? I have written the code and kept it simple, but I get an Error 1004: Specified value out of range. The error is in the line in red.
Code:
Dim Rng As Range
Dim img As Picture
dim sht as WorkSheet
sht = Sheet1
Set Rng = sht.Range("B15")
With Rng
[COLOR=#ff0000]Set img = ActiveSheet.Shapes.AddPicture(Image1.Picture, False, False, 5, 5, 1, 1)[/COLOR]
With img
.Height = 200
.Width = 120
.Left = Rng.Left
.Top = Rng.Top
End With
End With
Is this possible?
Can someone please help me?
Regards,
Last edited: