Hi, i had an issue in my job, i have to load an .txt file to excel but i can't get it to work help, the route it's fine and the msgBox displays the txt file, but the Open functions says err 53 not found...
Code:
Sub OpenTextFile()
Dim FilePath As String
FilePath = Dir(Application.ThisWorkbook.Path & "\bases\*.*")
MsgBox "" & FilePath
Dim TextLine
Open "" & FilePath For Input As [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=1]#1[/URL] ' Open file.
Do While Not EOF(1) ' Loop until end of file.
Line Input [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=1]#1[/URL] , TextLine ' Read line into variable.
Debug.Print TextLine ' Print to the Immediate window.
MsgBox "" & TextLine
Loop
Close [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=1]#1[/URL] ' Close file.
End Sub