Hi, I am having this error where I see it run in youtube but when I try it in my excel it gets automation error. What seems to be the problem? The color blue is the one getting error
Rich (BB code):
Sub Show_EmplPic()
Dim PicPath As String
With Sheet1
On Error Resume Next
.Shapes("EmplPic").Delete 'Delete Picture if it Exists
On Error GoTo 0
PicPath = .Range("J10").Value 'Path of the picture
If PicPath = Empty Then
.Shapes("DefaultPicture").Visible = msoCTrue
Exit Sub
End If
.Shapes("DefaultPicture").Visible = msoFalse
With .Pictures.Insert(PicPath)
With .ShapeRange
.LockAspectRatio = msoTrue
.Height = 97
.Name = "EmplPic"
End With 'Shape Range
End With 'Pictures
With .Shapes("EmplPic")
.Left = Sheet1.Range("I5").Left
.Top = Sheet1.Range("I5").Top
.IncrementLeft 53
.IncrementTop 14
End With 'Sheet 1
End With
End Sub