This is the first step in taking a large text file that has been broken up into smaller chunks, and rearranging for a MYSQL database.

At line 5630 it stops and gives the error.

Run-time error '1004':


Application-defined or object-defined error

When I do the debug it highlights the code at the following line:

Cells(NextRow, NextCol).Value = Data#
In :

fileToOpen = Application.GetOpenFilename("TEXT")
    FileNumber = FreeFile
    Open fileToOpen For Input As #FileNumber
    NextRow = 1
    NextCol = 1
    Countr = 0
    
    Do While Not EOF(FileNumber)
        Line Input #FileNumber, Data
        Countr = Countr + 1
        NextRow = NextRow + 1
        Cells(NextRow, NextCol).Value = Data
        Application.StatusBar = "Current Line " & Countr
    Loop
The file looks fine at the point where it stops.

The next step is to select values from each record but if I can only read in 5000 lines no need to work on that part, some of the records have more than 64000 lines so that is why I am using the line input command.

Thanks for any help or ideas, this is my first post to this forum so I apologize ahead of time if I didn't get format correct on posting a problem,

Patrick