Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Sub test()
Dim sFile, sinput As String
Dim lRow As Long
Dim lFNum As Long
lFNum = FreeFile
sFile = "F:\tektips\test.txt"
'Open the file
Open sFile For Input As lFNum
'Loop through the file until the end
Do While Not EOF(lFNum)
Line Input #lFNum, sinput
lRow = lRow + 1
Loop
Close lFNum
MsgBox lRow
End Sub
Yes, that is what the (FSO) TextStream.ReadAll is supposed to do but is very slow (100x slower than MichaelRed's function) and appears to lock up on very large files (although this may simply reflect the extended processing time).The KEY element is to get the entire file in "Memory" in the single statement