I make use of the typical INPUT and LOF statement to read in large textiles. Some text file are 100MB and gets read in with no problem. Other smaller files give the error as in the title.
VBA (Excel)
'Open file and read all lines in as strings
FileName = SumOutPath & "\" & WRYMPf & "SUM.OUT"
Erase v
sFile = FileName
Open sFile For Input As #1
sWhole = Input$(LOF(1), 1) 'This is where the error occurs some of the time
Close #1
v = Split(sWhole, vbNewLine)
Please help.
Thanks Bennie
I checked that the file is not in use and also deleted or added a blank row at the end of the file with no success