Skip to content
REFERENCE

U.WATCH_FILES

Summary

Watches the specified directory for changes to the specified file(s) and updates to the current time when a change occurs

Syntax

=U.WATCH_FILES([directory], [pattern], [top_directory_only], [polling_seconds])

Parameters

Parameter Required Description
[directory] No The directory to watch for file changes. Directory of current workbook is used if not provided. If a 2nd column is provided and set to TRUE then parameter is treated as a specific file and watch is for changes to that file
[pattern] No The filename to watch. Wildcard characters * and ? are supported. If no pattern is provided, then all files in the directory are watched. Ignored if 2nd column of TRUE is provided in the 1st parameter
[top_directory_only] No If set to TRUE then only the top directory is watched. By default subdirectories of the specified directory are also watched
[polling_seconds] No If set to a positive integer, a backup check will be performed on the interval of the specified number of seconds

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.WATCH_FILES("C:\My_Dir","some_file.xlsx")
=U.WATCH_FILES(C4,C5,TRUE)

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.