Hi everyone,
I've inserted pictures into my spreadsheet using the code below. I want to keep the aspect ratio, and have the top left of the picture starting from cell H20. It works fine with most. However a few pics instead of sitting nicely in that corner, they just float randomly (to the right and up from H20). And their top left corner doesn't fit into any cell, it's just in the middle. Do you know what could be the problem here? Thank you for your time
I've inserted pictures into my spreadsheet using the code below. I want to keep the aspect ratio, and have the top left of the picture starting from cell H20. It works fine with most. However a few pics instead of sitting nicely in that corner, they just float randomly (to the right and up from H20). And their top left corner doesn't fit into any cell, it's just in the middle. Do you know what could be the problem here? Thank you for your time
VBA Code:
Sub Present_Pic()
If PicPath = "" Then Exit Sub
Dim Pic As Picture, ImageCell As Range
Set ImageCell = Interface.Range("H20")
Set Pic = Interface.Pictures.Insert(PicPath)
With Pic
.Left = ImageCell.Left
.Top = ImageCell.Top
.Width = 400
End With
Set Pic = Nothing
End Sub