Skip to content
REFERENCE

U.FIND_FILE

Summary

Locates files or directories that match specified criteria and returns their full paths

Syntax

=U.FIND_FILE(filename, [top_directory], [dirs_to_ignore], [top_directory_only], [min_write_time], [limits], [block])

Parameters

Parameter Required Description
filename Yes The name of the file to find. The name may include standard Windows file search wildcard characters [*, ?]. If passed in dir() function …eg: dir(my_folder)… then searches for matching directory names instead of filenames
[top_directory] No The topmost directory to look in when searching for file. By default the directory in which the current workbook is located is searched. Precede with "[require_dir]" to only copy file if directory already exists
[dirs_to_ignore] No A list of subdirectories to ignore in search. Subdirectories of ignored directories will also be ignored. Not meaningful if top_directory_only is set to TRUE
[top_directory_only] No By default all subdirectories are searched. Set to TRUE to search only the specified top_directory and not its subdirectories
[min_write_time] No If set to a datetime, only files written after the specified time will be returned in results. When set a 2nd column is included in results that specifies the last write time of the file. Set to zero to include write time column without filtering
[limits] No The max number of results to return; if a negative number the results returned are the last ones found; default is unlimited. For FTP searches, a 2nd number can be provided to indicate the number of seconds before the search times out; default is 90 seconds if not set; set to -1 for no timeout When a timeout occurs, any partial results are returned but first row will contain "TIMEOUT!"
[block] No If set to TRUE then method will not be calculated unless triggered by user interaction or calculated as a step in a script; If set to a number then will be throttled to not calculate more frequently than the specified number of seconds; make number negative to prevent auto recalc of blocked methods

Behavior

The documented public interface is supported by the current U Add-in source signature and the maintained Usage Examples workbook. Optional parameters are shown in square brackets in the syntax above; omit the brackets when entering a formula.

Return Value

Returns the function result or action status described by the formula and parameters above. The maintained sources do not define a narrower, stable return contract for this function.

Examples

=U.FIND_FILE("myfile.xlsx","C:\MyFiles")
=U.DO(U.PAD(U.FIND_FILE(C5,C4,,,C7)),C8)

Notes

  • Formula examples are preserved from maintained workbook usage and normalized to the current U. prefix.
  • Complete formulas demonstrate working patterns; they do not imply that undocumented option values are supported.
  • Where maintained sources do not specify every accepted value, default, or error message, this page does not infer one.
  • For functions that perform actions, use a visible trigger or supported block/throttle parameter to avoid unintended repetition during recalculation.