I would like to read a txt file through VBA.
All the codes I found on the internet loop in the file (to get all the lines I suppose), but I wanted to just get the first line in a simpler way and put it in a variable.
Here is my current code, which takes the text but I do not think it's legal:
Dim conexao As String
Dim ReadData As String
Open "C:\Sistema\Conexao.txt" For Input As #1
Do Until EOF(1)
Line Input #1, ReadData
conexao = ReadData
If Not Left(ReadData, 1) = "*" Then
End If
Loop
Close #1