————————VBA—————————
Dim i As Integer
Dim sFilename As String
Dim bcontinue As Boolean
Dim spath As String
Sub Attempt1()
On Error Resume Next
‘spath = “\\192.168.0.45\Picture\ProductPic\”
spath = “D:\Vdo_Capture\ProductPic\”
i = 2
bcontinue = True
While bcontinue
sFilename = Worksheets(1).Cells(i, 2).Value
If sFilename = “” Then
bcontinue = False
Else
‘Set Position Pic A = 1
Cells(i, 1).Select
ActiveSheet.Pictures.Insert(spath + sFilename + “S1.jpg”).Select
Selection.ShapeRange.LockAspectRatio = msoFalse
Selection.ShapeRange.Height = 50
Selection.ShapeRange.Width = 50
i = i + 1
End If
Wend
End Sub
—————————END———————————-
Bookmarks