Originally Posted by
bhofsetz
You need to separate your GetOpenFilename statement from the OpenText statement.
So first GetOpenFilename assigns the full path of the text file you want to open.
Then Workbooks.OpenText operates on that.
revised code below:
Sub OpenTxtFile()
ChDir "C:\Samantha\Month-End In Progress"
FileToOpen = Application.GetOpenFilename("Text Files (*.txt), *.txt")
Workbooks.OpenText FileToOpen
If FileToOpen <> False Then
MsgBox "Open " & FileToOpen
End If
End Sub
Hope this helps
B
Bookmarks