By using expertatexcel.com you agree to our cookie policy, We and our partners operate globally and use cookies, for multiple purposes

Become an Σxpert at Σxcel.com

 


LoadData(sFile) - udf - loads a file's data to a string


Function LoadData(sFile as string)
Dim x
Dim sData As String
Dim sRec As String
x = bOpenSeqfile(sfile,"I")
if x < 0 then
    Msgbox "File " & sFile  " not found"
    Stop
End if

Line Input #x, sData
sRec = sRec & sData & vbCRLF
Do While Not Eof(x)
    Line Input #x, sData
    sRec = sRec & sData & vbCRLF    


Loop
LoadData = sRec
Close #x
End Function