Hi guys,
I have the following macro which works as follows: once run, it reads the product codes (e.g. 12381-1231) in column B and inserts corresponding product pictures from another folder to the excel file. Now the problem is that even when I save the document and then send it to others, they can not see the pictures.
Does anyone have a clue what I am doing wrong? Here is the code:
Sub InsertPics()
Dim Rw&, PFAD$, Datei$, Bild As Shape
PFAD = "\\levi.com\ls\Regional\LSE\BRU\DATA\Merchandising\H2'18\6. VLP\PICTURES"
With ActiveSheet
For Rw = 2 To 100
Datei = .Range("B" & Rw) & ".jpg"
If Dir(PFAD & Datei) <> vbNullString Then
.Pictures.Insert (PFAD & Datei)
Set Bild = .Shapes(.Shapes.Count)
Bild.LockAspectRatio = msoFalse
Bild.Left = .Range("A" & Rw).Left
Bild.Top = .Range("A" & Rw).Top
Bild.Width = .Range("A" & Rw).Width
Bild.Height = .Range("A" & Rw).Height
End If
Next
End With
End Sub
I have the following macro which works as follows: once run, it reads the product codes (e.g. 12381-1231) in column B and inserts corresponding product pictures from another folder to the excel file. Now the problem is that even when I save the document and then send it to others, they can not see the pictures.
Does anyone have a clue what I am doing wrong? Here is the code:
Sub InsertPics()
Dim Rw&, PFAD$, Datei$, Bild As Shape
PFAD = "\\levi.com\ls\Regional\LSE\BRU\DATA\Merchandising\H2'18\6. VLP\PICTURES"
With ActiveSheet
For Rw = 2 To 100
Datei = .Range("B" & Rw) & ".jpg"
If Dir(PFAD & Datei) <> vbNullString Then
.Pictures.Insert (PFAD & Datei)
Set Bild = .Shapes(.Shapes.Count)
Bild.LockAspectRatio = msoFalse
Bild.Left = .Range("A" & Rw).Left
Bild.Top = .Range("A" & Rw).Top
Bild.Width = .Range("A" & Rw).Width
Bild.Height = .Range("A" & Rw).Height
End If
Next
End With
End Sub