Excel: DIRECTORIES() Function Returns #N/A

Last reviewed: September 12, 1996
Article ID: Q96949
The information in this article applies to:
  • Microsoft Excel for Windows, versions 3.0, 4.0, 4.0a

SYMPTOMS

The DIRECTORIES() function in Microsoft Excel for Windows will return a #N/A error value if the specified directory contains more than 62 subdirectories. If the specified directory is your root drive, the limit will be 64 directories. This is a limitation of this function and as a result, there is no workaround.

STATUS

Microsoft has confirmed this to be a problem in the versions of Microsoft Excel listed above. We are researching this problem, and will post more information here in the Microsoft Knowledge Base as it becomes available.

MORE INFORMATION

The DIRECTORIES() function is available after loading the FILEFNS.XLA add- in macro and it returns a horizontal array of all of the subdirectories in the specified path or the current directory. The only argument for the DIRECTORIES() function is path_text. You use path_text to specify the full path of the directory for which you want a list of subdirectories. If the path_text argument is a root drive, as in the following example, the directory limit will be 64:

   =DIRECTORIES("D:\")

If, the path_text argument includes a directory, as in the following example, the limit will be 62:

   =DIRECTORIES("D:\TEST")

In this case, the horizontal array returned includes a dot (.) and a double dot (..) for the first two entries. These entries limit the number of actual subdirectories to 62. Following is an example of the first part of the returned array:

   ={".","..","TEST2","TEST3","TEST4"...}

REFERENCES

"Microsoft Excel Function Reference," version 4.0, page 114


KBCategory: kbusage
KBSubcategory:

Additional reference words: 3.0 3.00 4.0 4.00 4.0a 4.00a



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: September 12, 1996
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.