What I would suggest to do is Fix a cell in the Spreadsheet which will count
the Number of Rows you have and use that cell as EOF
Supposing you have Heading from Column A : I and Column A contains the
Unique Code then give the formula in J1 as counta(a2:a65636).
This will keep track of the number of Records you have. The same can be
used to define the END OF FILE (EOF)