Microsoft KB Archive/96949

{| = Excel: DIRECTORIES Function Returns #N/A =
 * width="100%"|

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(&quot;D:\&quot;) If, the path_text argument includes a directory, as in the following example, the limit will be 62: =DIRECTORIES(&quot;D:\TEST&quot;) 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: ={&quot;.&quot;,&quot;..&quot;,&quot;TEST2&quot;,&quot;TEST3&quot;,&quot;TEST4&quot;...}