Microsoft KB Archive/118656

{|
 * width="100%"|

Text Import Wizard Is Displayed Using OPEN? with Text File

 * }

-

The information in this article applies to:


 * Microsoft Excel for Windows, version 5.0

-

SYMPTOMS
In Microsoft Excel, when you use the OPEN? macro function to display the Open dialog box, the Text Import Wizard dialog box appears when you open a text file.

CAUSE
The Text Import Wizard appears when you open a text file to allow you to choose how you want the text file to be displayed. However, this dialog box appears even when you use a macro to display the Open dialog box.

This behavior may interfere with the functionality of your macro if your macro is designed to open and format a text file. This behavior occurs even if you set the Editable argument to TRUE, which is documented as being the same as holding down the SHIFT key while you choose the OK button in the Open dialog box.

Note that the Text Import Wizard does not appear when you open a file using the OPEN macro function.

WORKAROUND
To avoid having the Text Import Wizard appear when you open a text file using a macro, do any of the following:

 If you know the name of the file that you want to open, use the OPEN macro function with the name of the file to open the text file.  If you want to display the Open dialog box to choose which file to open, use the OPEN.DIALOG macro function to return the name of the file to open, and then use the OPEN function to open the file as in the following example:

Microsoft provides macro examples for illustration only, without warranty either expressed or implied, including but not limited to the implied warranties of merchantability and/or fitness for a particular purpose. This macro is provided as is and Microsoft in no way guaranties that the following code can be used in all situations and will not support modifications of the code to suit specific customer requirements.   A1: file=OPEN.DIALOG A2: =OPEN(file) A3: =RETURN 

STATUS
Microsoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article. This problem was corrected in Microsoft Excel for Windows version 5.0c.

MORE INFORMATION
In Microsoft Excel version 5.0c, you can set value of the Editable argument to true in the OPEN? function to avoid having the Text Import Wizard appear when you open a text file. The following is an example of using this method:

  =OPEN?(,,,,,,,,,,TRUE)