So i previous was using below coding and it works perfectly fine until i got to share it with someone.
i know i have to use the below coding but try to insert in several places it says "Expression error", so where should i put this in my original coding?
LinkToFile:=msoTrue, _ SaveWithDocument:=msoFalse
_______________________________________________________________________________________________________________________________
Sub InsertPhoto()
Dim i As Integer
Dim all_std As Integer
all_std = ActiveSheet.UsedRange.Rows.Count
On Error GoTo Close_Error
Dim x As Integer
x = 2
For i = x To all_std + 1
Cells(i, 21).Select
ActiveSheet.Pictures.Insert( _
"I:\2022\02_Campaign\04_Spring22\02_Images\PDP_SS22\00. all image\" & Cells(i, 19) & ".PNG").select_
Selection.ShapeRange.IncrementLeft 10.5
Selection.ShapeRange.IncrementTop 6#
Selection.ShapeRange.LockAspectRatio = msoTrue
Selection.ShapeRange.Height = 60.25
Selection.ShapeRange.Width = 60.25
Selection.ShapeRange.Rotation = 0#
x = x + 1
Next i
Close_Error:
i = x
Resume Next
x
End Sub
i know i have to use the below coding but try to insert in several places it says "Expression error", so where should i put this in my original coding?
LinkToFile:=msoTrue, _ SaveWithDocument:=msoFalse
_______________________________________________________________________________________________________________________________
Sub InsertPhoto()
Dim i As Integer
Dim all_std As Integer
all_std = ActiveSheet.UsedRange.Rows.Count
On Error GoTo Close_Error
Dim x As Integer
x = 2
For i = x To all_std + 1
Cells(i, 21).Select
ActiveSheet.Pictures.Insert( _
"I:\2022\02_Campaign\04_Spring22\02_Images\PDP_SS22\00. all image\" & Cells(i, 19) & ".PNG").select_
Selection.ShapeRange.IncrementLeft 10.5
Selection.ShapeRange.IncrementTop 6#
Selection.ShapeRange.LockAspectRatio = msoTrue
Selection.ShapeRange.Height = 60.25
Selection.ShapeRange.Width = 60.25
Selection.ShapeRange.Rotation = 0#
x = x + 1
Next i
Close_Error:
i = x
Resume Next
x
End Sub