Answers for "excel vba open text file"

VBA
3

excel vba open text file

'VBA function to open text file and retrieve the entire content
'as a string:

Function OpenTextFile$(f)
    With CreateObject("ADODB.Stream")
        .Charset = "utf-8"
        .Open
        .LoadFromFile f
        OpenTextFile = .ReadText
    End With
End Function

'--------------------------------------------------------------------

s = OpenTextFile("C:\123.json")
MsgBox Len(s)
Posted by: Guest on April-21-2020

Code answers related to "VBA"

Browse Popular Code Answers by Language