Hi,
I have the following code that pastes an image from a URL into a cell where rngPicPosition is variable, it changes for each loop in my full code so first loop is .cells(5,3) next loop is .cells(10,3).. .cells(10,5) however it's pasting the image into the activecell.
Any ideas why? I'm stumped.
Also, is there a way to skip the With Pic part and when pasting in but still use them measurements?
It pastes in fully on but I want it to paste in rngPicPostion.
I have the following code that pastes an image from a URL into a cell where rngPicPosition is variable, it changes for each loop in my full code so first loop is .cells(5,3) next loop is .cells(10,3).. .cells(10,5) however it's pasting the image into the activecell.
Any ideas why? I'm stumped.
Also, is there a way to skip the With Pic part and when pasting in but still use them measurements?
It pastes in fully on but I want it to paste in rngPicPostion.
Code:
Set Pic = .Parent.Pictures.Insert(URL)
Code:
Set rngPicPosition = Worksheets(template.Name).Cells(iStartRow, iStartColumn)
URL = "http://media.topshop.com/wcsstore/TopShop/images/catalog/TS" & .Cells(x, 10) & "_Large_F_1.jpg" '-- URL storing Line No. if not found in directory.
With rngPicPosition
On Error Resume Next
Set Pic = .Parent.Pictures.Insert(URL)
With .rngPicPosition
Pic.Top = .Top
Pic.Left = .Left
Pic.Height = .Height
Pic.Width = .Width
End With
With Pic
.Top = Pic.Top + 8.7
.Left = Pic.Left + 26.1
.Width = 92.6929242
.Height = 100.629933
End With
Set Pic = Nothing
End With
Last edited: