Excel: FILES() Function Limited to 256 Filenames

ID: Q99926


The information in this article applies to:


SUMMARY

The FILES() function returns a horizontal array of the names of all files in a specified directory or folder. The number of filenames that this function can return is limited to a maximum of 256.


MORE INFORMATION

Although the FILES() function will not return more than 256 filenames at one time, you can use one of the following procedures to narrow the number of files the FILES() function searches for.

Specify the Type of File You Want to Find

You can specify which files you want the FILES() function to return. For example, FILES("C:\EXCEL\*.XLS") will return all files with an .XLS extension and FILES("C:\EXCEL\MAY*.XLS") will return all files that start with MAY and end with .XLS.

NOTE: This method allows the FILES() function to create an array for each type of file you want a list for (provided the list of files does not exceed 256 names).

Categorize Files of Like Names in Separate Directories

You can categorize files into separate directories on the hard drive and then use the FILES() function to build a list of filenames for each directory.


REFERENCES

"Online Help," version 5.0
"Function Reference", version 4.0, page 147

Additional query words: 3.0 4.0 4.00a 5.0 limit limitation


Keywords          : 
Version           : 3.00 4.00 4.00a 5.00
Platform          : WINDOWS 
Issue type        : 

Last Reviewed: July 23, 1999