mave27
New Member
Ok- i have successfully managed to bulk upload images from Folder to worksheet, but image size is much smaller than original image stored in the folder.
The Orig image size is 600pxx500px, yet the sheet is showing a thumbnail size ?!
See screenshot below
http://postimg.org/image/5mxpl3ua7/
Below is macro code:
How can I fix this ?
The Orig image size is 600pxx500px, yet the sheet is showing a thumbnail size ?!
See screenshot below
http://postimg.org/image/5mxpl3ua7/
Below is macro code:
Code:
Sub InsertPic()
Dim path As String, pic As String, pname As String
Dim lastrow As Long, r As Range
path = "C:\Users\user\Desktop\MagentoCatalog\product\" 'change as req
lastrow = Range("B" & Rows.Count).End(xlUp).Row
For Each r In Range("B2:B" & lastrow)
pic = r.Value
pname = path & pic & ".jpg"
If Dir(pname) <> "" Then
With ActiveSheet.Pictures.Insert(pname)
With .ShapeRange
.LockAspectRatio = msoTrue
.Height = 125
.Width = 35
End With
.Left = Columns("C").Left
.Top = Rows(r.Row).Top
End With
Rows(r.Row).RowHeight = 125
r.Offset(0, 2).Value = pic
Else
Cells(r.Row, "C") = "**** File Not Found *****"
End If
N: Next
End Sub
How can I fix this ?