Open txt file with macro
Hello everybody
I have this code that gives me error .... instruction in red, it should open a dialog box to choose a txt file.
[SIZE="2"]Private Sub CommandButton3_Click()
filetoOpen = Application _
.GetOpenFilename("Text Files (*.txt), *.txt")
Workbooks.OpenText Filename:=
filetoOpen , Origin:=xlWindows, StartRow:=1, DataType:=xlDelimited, TextQualifier _
:=xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=True, Semicolon:= _
False, Comma:=False, Space:=False, Other:=False, FieldInfo:=Array(Array _
(1, 1), Array(2, 1), Array(3, 1), Array(4, 1), Array(5, 1), Array(6, 1), Array(7, 1)), _
TrailingMinusNumbers:=True
End Sub[/SIZE]
|