By ethnicsofkutch on Saturday, 23 April 2022
Posted in Kutools for Excel
Replies 0
Likes 0
Views 1.9K
Votes 0
This code treats even non image path cell as image path and props up error that it could not import file name " text in that cell"
This used to work well before some days, any clue?

Sub InsertPicFromFile()
Dim xRg As Range
Dim xCell As Range
Dim xVal As String
On Error Resume Next
Set xRg = Application.InputBox("Please select file path cells:", "KuTools for Excel", Selection.Address, , , , , 8)
If xRg Is Nothing Then Exit Sub
Application.ScreenUpdating = False
For Each xCell In xRg
xVal = xCell.Value
If xVal <> "" Then
ActiveSheet.Shapes.AddPicture xCell.Value, msoFalse, msoTrue, _
xCell.Offset(0, 1).Left, xCell.Top, xCell.Height, _
xCell.Height
End If
Next
Application.ScreenUpdating = True
End Sub
View Full Post