ThrottleWorks
Excel Ninja
Hi,
Am using below code to load image in UserForm.
File path is correct. File formant and name is also correct.
However when I try to run this code I get bug saying Invalid Picture at BOLD line. How di I resolve this.
Can anyone please help me in this.
>>> use code - tags <<<
Am using below code to load image in UserForm.
File path is correct. File formant and name is also correct.
However when I try to run this code I get bug saying Invalid Picture at BOLD line. How di I resolve this.
Can anyone please help me in this.
>>> use code - tags <<<
Code:
Sub Add_Dynamic_Image()
'Add Dynamic Image and assign it to object 'Img'
Set Img = UserForm2.Controls.Add("Forms.Image.1")
With Img
'Load Picture to Image Control
MyPath = "This Path is correct"
' next line is bolded
.Picture = LoadPicture(MyPath & "FileName.JPG") 'Change Image Path here
'Align the Picture Size
.PictureSizeMode = fmPictureSizeModeStretch
'Image Position
.Left = 50
.Top = 10
End With
End Sub
Last edited by a moderator: