Opens a text file much fast than a “Do While Not EOF(filenumber)” loop. Makes
file load times almost non-existant.
Original Author: Timothy Pew
Inputs
The filename of the file to open.
Assumptions
The filename that you pass to the function must exist, otherwise an error will occur.
Returns
The text contained in the file.
Side Effects
I have yet to run into any. If you do happen to find one leave a comment and
I will fix it.
Code
Public Function OpenFile(ByVal file As String) As String
Dim i As Integer
i = FreeFile
Open file For Input As #i
OpenFile = Input(LOF(i), i)
Close #i
End Function