Error - Input past end of file - but I'm only reading one line?

I’m trying to read the first (and only) line from a text file, and am getting the error - “Input past end of file”. How can this be happening? - or more importantly, how can I correct it?

This is my code snippet:

Dim filenum As Integer

filenum% = Freefile()



Open fullpath For Input As filenum%

Line Input #fileNum%, retvalue

I only execute it once, no looping. Any ideas?

Subject: Error - Input past end of file - but I’m only reading one line?

this error occurs usually, if the file length is zero Bytes. You can either check the file length before the Line Input command or use an’on error goto’ routine.

Subject: Error - Input past end of file - but I’m only reading one line?

Are you, in fact, setting the value of the variable fullpath?

Subject: Yes, fullpath is set earlier in the script

It contains the full file path of where the file is.