Hi everyone,
I'm stuck in VBA. I'm probably missing a simple part but I can't figure it out.
I've made a userform that collects information out of a database. Now the difficult part: When the name changes, it should download the corresponding picture (link in Cell offset 37). Sometimes it can't download that files, in that case it should show a "no picture available" picture (link in offset 39).
The macro works fine untill the Error part, when it can't download the picture...
Here's the part of macro so far:
Private Sub CboMedew_Change()
Dim url_path As String
Dim file_path As String
url_path = rName.Offset(0, 37).Value
file_path = ThisWorkbook.Path & "\" & "Image.png"
' Download picture
DownloadFilefromWeb url_path, file_path
On Error Resume Next
url_path = rName.Offset(0, 39).Value
file_path = ThisWorkbook.Path & "\" & "Image.png"
With Image2
.Picture = LoadPicture(file_path)
End With
' Delete Saved file
Kill file_path
End Sub
Bookmarks