Directories Function Returns an Error in Excel

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 "Microsoft Excel User's Guide," 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 "User's Guide" 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("")

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 "Function Reference" 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("")

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. \*

REFERENCES

"Function Reference," version 4.0, page 114

"Microsoft Excel User's Guide," version 3.0, Appendix B, page 680


KBCategory: kbother kbdocerr
KBSubcategory:

Additional reference words: 2.00 2.0 2.01 2.1 2.10 2.2 2.21 2.20 3.00
3.0 docerr addins


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: November 30, 1994
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.