Sub Sample4()
Dim IMG As Object
Set IMG = LoadPicture("C:\Work\Sample.jpg")
With ActiveCell.AddComment
.Shape.Fill.UserPicture "C:\Work\Sample.jpg"
.Shape.Height = Application.CentimetersToPoints(IMG.Height) / 1000
.Shape.Width = Application.CentimetersToPoints(IMG.Width) / 1000
.Visible = True
End With
End Sub
Sub Sample5()
Dim IMG As Object
If TypeName(ActiveCell.Comment) = "Comment" Then Exit Sub
Set IMG = LoadPicture("C:\Work\Sample.jpg")
With ActiveCell.AddComment
.Shape.Fill.UserPicture "C:\Work\Sample.jpg"
.Shape.Height = Application.CentimetersToPoints(IMG.Height) / 1000
.Shape.Width = Application.CentimetersToPoints(IMG.Width) / 1000
.Visible = True
End With
End Sub