ebea
Active Member
- Joined
- Jul 12, 2008
- Messages
- 302
- Office Version
- 2021
- Platform
- Windows
Hi! A problem, loading pictures into an image form. I use the image on a UserForm, together with Textboxes, which are loaded by the following code:
But I can't get the images to load as wanted. I have set image name for all rows, into Column O (in this case).
I get the error message "Path not found". And no matter how I set the path, it comes with an error. If I load image "normally", as this: Image1.Picture = LoadPicture("C:\xxx\xxx\1001.jpg") it will works.
Does anybody have a guess of the problem?
But I can't get the images to load as wanted. I have set image name for all rows, into Column O (in this case).
I get the error message "Path not found". And no matter how I set the path, it comes with an error. If I load image "normally", as this: Image1.Picture = LoadPicture("C:\xxx\xxx\1001.jpg") it will works.
Does anybody have a guess of the problem?
Code:
Private Sub CommandButton1_Click()
Box = TextBox14.Value
With Sheets("dj")
For Rows = 3 To .UsedRange.Rows.Count
If Int(Range("B" & Rows).Value) = Int(Box) Or Range("B" & Rows).Value = Box Then
TextBox1.Value = .Range("B" & Rows).Value
TextBox2.Value = .Range("C" & Rows).Value
TextBox8.Value = .Range("D" & Rows).Value
Image1.Picture = LoadPicture("C:\xxx\xxx").Range("O" & Rows).Value
Exit Sub
End If
Next Rows
End With
End Sub
Last edited by a moderator: