XL5: Invalid Filename Entered in Linked List Closes Dialog

ID: Q112174


The information in this article applies to:
  • Microsoft Excel for Windows, versions 5.0, 5.0c
  • Microsoft Excel for Windows 95, version 7.0


SYMPTOMS

In Microsoft Excel versions 5.x or 7.0, if you enter an invalid filename in the edit box of a linked file/drive and directory list box in a custom dialog box that you created in Microsoft Excel version 4.0, the dialog box is closed when you choose OK. This problem also occurs with any filename that contains characters such as the backslash (\) and asterisk (*) that you normally use to change directories or display files with different filename extensions.


WORKAROUND

In order to use a linked file/directory box in a custom dialog box that changes directories or displayed files when you type certain characters (such as the backslash or asterisk), test the value entered in the edit box for the specified character, and display the dialog box again with the desired value. For example, the following macro searches for an asterisk in the entered value. If the asterisk is found (the SEARCH() function does not return an error) the custom dialog box is displayed again and the entered value is displayed in the edit box:


   A1: Linked_List
   A2: finished=FALSE
   A3: =WHILE(finished=FALSE)
   A4: dialog_box=DIALOG.BOX(box)
   A5: =IF(dialog_box=FALSE,RETURN())
   A6: finished=ISERR(SEARCH("~*",$G$2))
   A7: =NEXT()
   A8: =RETURN() 
In the above macro, $G$2 is the cell on the macro sheet that contains the value you enter in the edit box above the linked file/directory box. You can use a similar macro to check for the backslash character, change directories, and display the dialog box again.

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.


STATUS

Microsoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.

Additional query words: 5.00c

Keywords :
Version : 5.00 5.00c 7.00
Platform : WINDOWS
Issue type :


Last Reviewed: September 16, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.