Pyd
0
Q:

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)
2

New to Communities?

Join the community