Runtime error 53

Apolin

New Member
Joined
Aug 16, 2018
Messages
2
hello friends
Newly I am studying excel VBA. when i am coding one school program Run time 53 (file not found) error occurred.

Me.Image1.Picture = LoadPicture(ThisWorkbook.Path & "" & TextBox1.Value & ".jpg")

please tell me what is wrong in this? and explain me about these codes.

Thanks

Apolin
 

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.
Try
Code:
[COLOR=#333333]Me.Image1.Picture = LoadPicture(ThisWorkbook.Path & "\" & TextBox1.Value & ".jpg")[/COLOR]
 
Upvote 0
Thanks, but its not working. I am showing you all the codes. please see
Private Sub TextBox1_Change()
Dim i As Long, lastRow As Long, ws As Worksheet
Set ws = Sheets("I A NEW")
lastRow = ws.Range("A" & Rows.Count).End(xlUp).Row
For i = 2 To lastRow
If Val(Me.TextBox1.Value) = ws.Cells(i, "A") Then
Me.TextBox2 = ws.Cells(i, "B").Value
Me.TextBox3 = ws.Cells(i, "C").Value
Me.TextBox4 = ws.Cells(i, "D").Value
Me.Image1.Picture = LoadPicture(ThisWorkbook.Path & "" & TextBox3.Value & ".jpg")
End If
If TextBox1 = "" Then
Me.TextBox1 = ""
Me.TextBox2 = ""
Me.TextBox3 = ""
Me.TextBox4 = ""
Me.TextBox6 = ""
Me.TextBox7 = ""
Me.Image1.Picture = LoadPicture("")
End If
Next i


End Sub
 
Upvote 0
Have you confirmed the file is in the correct place?.

debug.print ThisWorkbook.Path & "" & TextBox3.Value & ".jpg"
 
Upvote 0

Forum statistics

Threads
1,223,896
Messages
6,175,259
Members
452,626
Latest member
huntinghunter

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