Image load

ebea

Active Member
Joined
Jul 12, 2008
Messages
296
Office Version
  1. 2021
Platform
  1. 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?
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:

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.
;) I think I have it all clear now. There was two issues. The First was, that i haven't changed the Image Control, from 1 to 2 in the tabs on Multipage. And second was, that there was errors in some of the images (there are nearly Thousands to keep in order).
So i think all is running now. I will test it all, more here later, but I think all is okay!
Once again, thanks for you'r time and help ;)
 
Upvote 0

Forum statistics

Threads
1,215,063
Messages
6,122,935
Members
449,094
Latest member
teemeren

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top