Article ID: 125401
Article Last Modified on 11/23/2006
Application.Dialogs(xlDialogOpen).Showthe Text Import Wizard is displayed automatically if you open a text file. If you want to suppress the Text Import Wizard, you must use the OpenText method.
Sub OpenWOTextImportWiz()
Dim MyFile As Variant
' Ask the user for the file name to open.
MyFile = Application.GetOpenFilename
' Check for the Cancel button.
If MyFile = False Then Exit Sub
' Open the Text file with the OpenText method.
Workbooks.OpenText Filename:=MyFile, Origin:=xlWindows, _
StartRow:=1, DataType:=xlDelimited, _
TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False, _
Tab:=True, Semicolon:=False, Comma:=False, Space:=False, _
Other:=False, FieldInfo:=Array(1, 1)
End Sub
Note that the OpenText method may require different parameters for your
specific macro.
Additional query words: 5.00c 8.00 XL98 XL97 XL7 XL5
Keywords: kbhowto kbprogramming kbcode KB125401