Vba Get Text File Content

[Solved] Vba Get Text File Content | Vb - Code Explorer | yomemimo.com
Question : vba get text file content

Answered by : vastemonde

' Returns an array of lines from a text file
Function FileInArray() As Variant Dim fileSO As Object, textFile As Object, content On Error GoTo CExit Set fileSO = CreateObject("Scripting.FileSystemObject") Set textFile = fileSO.OpenTextFile("C:\temp\file.txt", 1) content = textFile.ReadAll FileInArray = Split(content, vbNewLine) textFile.Close
CExit:
End Function

Source : | Last Update : Sun, 21 Feb 21

Answers related to vba get text file content

Code Explorer Popular Question For Vb