runtime error 62 - input past end of file
Posted on 2006-11-03
I'm writing an app that reads in hundreds of (not so large - 400kb or so) column delimited text files into an array, one at a time, and does some processing on each one. I can get through about 20 or 30 of the files, and then I hit one in particular, and my app exits with:
"runtime error 62 - input past end of file"
I've checked the text file over and can't see why it's causing my app to act up. It's just a text file. The code below is where it's acting up. What's wrong with it? Is there any kind of "while not EOF' I can add to this to make it more robust?
Dim arrayMyFile () As String
Sub GrabThatFile(TheFilePath, TheFileName)
Dim fnum As Integer
fnum = FreeFile()
Open TheFilePath & TheFileNameFor Input As #fnum
arrayMyFile = Split(Input(LOF(fnum), #fnum), vbCrLf)