Sample Macro to Open a Text File Without Displaying TextWizard (125401)
The information in this article applies to:
- Microsoft Excel for Windows 5.0
- Microsoft Excel for Windows 5.0c
- Microsoft Excel for Windows NT 5.0
- Microsoft Excel for Windows 95
- Microsoft Excel for Windows 95 7.0a
- Microsoft Excel 97 for Windows
- Microsoft Excel for the Macintosh 5.0
- Microsoft Excel for the Macintosh 5.0a
- Microsoft Excel 98 Macintosh Edition
This article was previously published under Q125401 SUMMARY
When you create a Microsoft Visual Basic for Applications macro or
procedure that contains the following line of code:
Application.Dialogs(xlDialogOpen).Show
the 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.
The code in the following sample macro uses the GetOpenFilename method to
obtain the name of the file the user wants to open. It then uses the
OpenText method to specify all the parameters for the Text Import Wizard
without having the Text Import Wizard display on the screen.
Modification Type: | Minor | Last Reviewed: | 9/13/2006 |
---|
Keywords: | kbcode kbhowto kbProgramming KB125401 |
---|
|