Note: The other languages of the website are Google-translated. Back to English
  Saturday, 23 April 2022
  0 Replies
  818 Visits
0
Votes
Undo
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
There are no replies made for this post yet.

Follow Us

Copyright © 2009 - www.extendoffice.com. | All rights reserved. Powered by ExtendOffice. | Sitemap
Microsoft and the Office logo are trademarks or registered trademarks of Microsoft Corporation in the United States and/or other countries.
Protected by Sectigo SSL