Image load

ebea

Active Member
Joined
Jul 12, 2008
Messages
302
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

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).
;-) 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,224,825
Messages
6,181,191
Members
453,021
Latest member
pingpong7117

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