Guys please help me. I'll try to create a program which computes average for the entry of students grade through NOTEPAD..The file "Scores.txt" is in my desktop. If ill try to run my program this error appears: ""run time error 53" file not found". What should I do. Where will I put "scores.txt".This are my codes: Hope you can help me.

Private Sub Command1_Click()
Dim total As Integer, student As Integer, average As Single
Dim nom(1 To 4) As String, score(1 To 4) As Integer

Open "SCORES.TXT" For Input As #1
For student = 1 To 4
Input #1, nom(student), score(student)
Next student
Close #1

total = 0
For student = 1 To 4
total = total + score(student)
Next student
average = total / 4
MsgBox average

End Sub

Recommended Answers

All 2 Replies

The error message itself suggests the reason of error. U need to specify complete path of the file. Else u can store the file in the path of the exe and specify App.path in the code to avoid this error message.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.