Skip to content

Instantly share code, notes, and snippets.

@eggist77
Last active August 7, 2021 11:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eggist77/2412cea45d01373a8e27b2b2daeff348 to your computer and use it in GitHub Desktop.
Save eggist77/2412cea45d01373a8e27b2b2daeff348 to your computer and use it in GitHub Desktop.
vba read text
Sub read_text()
Dim buf As String
Dim n As Integer 'file number
Dim file As String
file = "C:\tmp\test.txt"
n = FreeFile
Open file For Input As #n
Do While Not EOF(n)
Line Input #n, buf
MsgBox buf
Loop
Close #n
End Sub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment