Hi,
I have the below macro and just got a new work comp. New comp is unable to run my macro now. I think it might be a Windows 10 issue? I'm also running Office 365. Can anyone please help? I essentially need to have a macro look up a number in column E, find the corresponding jpg in a specific folder, and populate that image in column B.
Thanks in advance for your help!
I have the below macro and just got a new work comp. New comp is unable to run my macro now. I think it might be a Windows 10 issue? I'm also running Office 365. Can anyone please help? I essentially need to have a macro look up a number in column E, find the corresponding jpg in a specific folder, and populate that image in column B.
Thanks in advance for your help!
Code:
Sub Kok()
On Error Resume Next
Dim i%, ppath$, sku$
For i = 6 To 500
sku = Cells(i, 5)
ppath = "H:\Retail\E-Commerce\Photo Shoots" & sku & "" & sku & "_00_r17.jpg"
With ActiveSheet.Pictures.Insert(ppath)
With .ShapeRange
.LockAspectRatio = msoTrue
.Width = 30
.Height = 40
End With
.Left = ActiveSheet.Cells(i, 2).Left
.Top = ActiveSheet.Cells(i, 2).Top
.Placement = 1
.PrintObject = True
End With
Next
End Sub
Last edited by a moderator: