** RESOLVED with Resume ResumeCode under "rngPicPosition = "IMAGE UNAVAILABLE""
Hi,
I'm trying to import a picture using an URL, if the picture isn't found then go to my Error Handling code. Which works fine on the first loop but then fails on the 2nd +.
Any suggestions? I'm 100% sure it's the easiest thing probably like an On Error Goto 0 after where it breaks but I can't seem to figure it out.
Here's the code and the code below is where it will break.
Thanks,
Hi,
I'm trying to import a picture using an URL, if the picture isn't found then go to my Error Handling code. Which works fine on the first loop but then fails on the 2nd +.
Any suggestions? I'm 100% sure it's the easiest thing probably like an On Error Goto 0 after where it breaks but I can't seem to figure it out.
Here's the code and the code below is where it will break.
Code:
With Sheets("Template").Cells(iStartRow, iStartColumn)
.Select
On Error GoTo ErrHandler
Set Pic = .Parent.Pictures.Insert(URL)
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
GoTo ResumeCode
ErrHandler:
rngPicPosition = "Image Unavailable"
ResumeCode:
'Insert Line No. values e.g. Name, Stock Units, RRP, Units Sold, Cover.
rngPicPosition.Offset(1, 0) = .Cells(x, 10)
Code:
Set Pic = .Parent.Pictures.Insert(URL)
Thanks,
Last edited by a moderator: