Hi experts!
I have an Excel VBA that will look up a cell value and insert the picture in a designated cell in return. I have already included the LinkToFile:=msoFalse and SaveWithDocument:=msoTrue. However, I still can't see the photos when I open the file in another computer.
Can you all help me take a look at my VBA codes and see where did I do wrong? Does it also matter which Excel format I save the file in?
Thanks a lot in advance!!!!
Below is the VBA Code:
Private Sub Worksheet_change()
Dim myPict As Picture
Dim PictureLoc As String
If Target.Address = Range("B2").Address Then
PictureLoc = "C:\Users\Paul.Man\Pictures\Product pics\" & Range("B2").Value & ".png"
With Range("A2")
Set myPict = ActiveSheet.Shapes.AddPicture( _
PictureLoc, _
LinkToFile:=msoFalse, _
SaveWithDocument:=msoTrue, _
Top:=imgTop, _
Left:=imgLeft)
End With
End If
End Sub
I have an Excel VBA that will look up a cell value and insert the picture in a designated cell in return. I have already included the LinkToFile:=msoFalse and SaveWithDocument:=msoTrue. However, I still can't see the photos when I open the file in another computer.
Can you all help me take a look at my VBA codes and see where did I do wrong? Does it also matter which Excel format I save the file in?
Thanks a lot in advance!!!!
Below is the VBA Code:
Private Sub Worksheet_change()
Dim myPict As Picture
Dim PictureLoc As String
If Target.Address = Range("B2").Address Then
PictureLoc = "C:\Users\Paul.Man\Pictures\Product pics\" & Range("B2").Value & ".png"
With Range("A2")
Set myPict = ActiveSheet.Shapes.AddPicture( _
PictureLoc, _
LinkToFile:=msoFalse, _
SaveWithDocument:=msoTrue, _
Top:=imgTop, _
Left:=imgLeft)
End With
End If
End Sub