Microsoft KB Archive/71255

{| = Directories Function Returns an Error in Excel =
 * width="100%"|

Last reviewed: November 30, 1994

Article ID: Q71255 The information in this article applies to:
 * Microsoft Excel for Windows, version 3.0
 * Microsoft Excel for the Macintosh, version 3.0

SYMPTOMS
The &quot;Microsoft Excel User's Guide,&quot; version 3.0, incorrectly states that the add-in FILEFNS.XLA DIRECTORIES macro will return a list of the subdirectories in the current directory when the argument is omitted. The &quot;User's Guide&quot; shows the following macro formula:

=DIRECTORIES If you enter the function this way, the #VALUE! error is returned.

WORKAROUNDS
To return a list of the subdirectories in the current directory, use the DIRECTORY function to provide the current directory name for the DIRECTORIES function as in the following example:

=DIRECTORIES(DIRECTORY) You can also use the DIRECTORIES function with any directory as a string argument, or with an empty string such as the following =DIRECTORIES(&quot;&quot;) This example correctly returns an array of all subdirectories in the root directory of the current drive.

STATUS
This problem has been corrected in Microsoft Excel version 4.0.

MORE INFORMATION
In Microsoft Excel version 4.0, you can use the DIRECTORIES function without the quotation marks to return the subdirectories in the current directory. However, the Microsoft Excel version 4.0 &quot;Function Reference&quot; shows an incorrect example using quotation marks, and states that this method will return a list of the subdirectories in the current directory. Instead, when you use the function as in the following example

=DIRECTORIES(&quot;&quot;) a list of the subdirectories in the root directory of the current drive is returned. Note that the File Functions add-in is not included in Microsoft Excel version 5.0. However, if you install Microsoft Excel version 5.0 to the directory that contains Microsoft Excel version 3.0 or 4.0, you can open or load the file FILEFNS.XLA and use the functions contained in the add-in. \*