Error 62, “Input past end of file”, means code tried to read data that is not there: a read executed after the file's end was reached. The standard cause is a loop that reads first and checks later, a fixed read count that assumes more records than the file holds, or a Get aimed past the last record of a random-access file. The file is fine; the code's idea of how much is in it is wrong.
Do While Not EOF(fn)
Line Input #fn, lineText
Process lineText
Loop
' The reverse order (read, then check) reads once too often: error 62.
LOF(fn) / recordLength for random access.Input(n, #fn) asking for more characters than remain, and Input # running past the final delimiter, both raise 62. Read the remainder via LOF arithmetic when the tail matters.If the loop is textbook and error 62 still fires, the file may end mid-record: a truncated random-access file whose length is not a multiple of the record length makes the final Get reach past real data. Compare LOF against the expected multiple to confirm truncation.
What is the difference between error 62 and error 53? Error 53 means the file was not found at open time. Error 62 means the file opened fine but a read went past its end. One is about existence, the other about length.
Can a correct loop still hit error 62? Yes, if the file is truncated or empty. The loop guards against over-reading a complete file; a file that ends mid-record defeats record-based reads, which is why intake size checks matter.