Skip to content
REFERENCE

U.MONITOR_WORKBOOK

Summary

Automatically open/restarts/closes workbooks according to specified schedules and monitors them to ensure they remain open and responsive

Syntax

=U.MONITOR_WORKBOOK(workbook_name, [top_directory], [max_wait_minutes], [open_as_readonly], [open_time], [close_time], [save_before_close], [notify], [days_of_week], [holidays], [manual_calc_mode_ok], [global], [keyboard_shortcut], [voice_shortcut], [rebuild_calc_tree], [prevent_sleep])

Parameters

Parameter Required Description
workbook_name Yes The workbook to be monitored. If only a name is provided and not a full path, then workbook is found in the specified top_directory or the directory of the current workbook if top_directory is not specified. If not set then a report of all schedules is returned. Set to "PAUSE" (or FALSE) or "RESUME" (or TRUE) to pause/resume monitoring of the current workbook. Set to "CLEAR" to delete all schedules
[top_directory] No The directory in which the workbook can be found if the 1st parameter does not contain a full path. Set to "PAUSE" (or FALSE) or "RESUME" (or TRUE) to pause/resume an existing schedule for specified workbook. Set to a positive integer to only pause for that many hours. Set to "CLEAR" to clear the schedule for the workbook specified in the 1st parameter.
[max_wait_minutes] No The maximum time in minutes that the monitoring will await a response from Excel before assuming it is frozen and must be forcibly restarted. By default Excel is given up to 2 minutes to respond before monitoring takes stronger measures to force a response and restarts the workbook if those measures are unsuccessful. Default is 15 minutes if notify recipients provided. Max of 180 and min of 0.5 is enforced
[open_as_readonly] No Set to TRUE to have the workbook opened in readonly mode. Default is to start as editable if possible
[open_time] No The local time at which the workbook should be opened. If not set, then workbook is kept open constantly. If open_time is set but close_time is not set, then workbook is opened at specified time but not monitored so if manually closed it will not be re-opened automatically until the open_time on the following day
[close_time] No The local time which the workbook should be closed. If not set, then the workbook is never closed automatically. If set but no open_time is set, then the workbook will be bounced (closed then immediately re-opened) at the specified time
[save_before_close] No Set to TRUE to have the workbook saved before it is closed automatically. By default the workbook is not saved before it is closed on a scheduled close_time
[notify] No The list of email addresses and/or phone numbers (if text messaging enabled) that should receive notification about a frozen workbook. When provided, a notification of a potentially frozen sheet is sent early (before the full max wait has elapsed) to give the user a chance to intervene manually before the workbook is forcibly restarted. The default max wait is 15 minutes when notify recipients are provided
[days_of_week] No The days of week (Monday = 1, Sunday =7) on which the schedule should be observed. Can be provided as either a comma-delimited list of numbers or as numbers in a range of cells. If not set then workbook is monitored on every day of the week
[holidays] No The dates on which the schedule should not be observed. If not set then the workbook is monitored every day
[manual_calc_mode_ok] No Set to TRUE to allow monitored workbook to be open in manual calculation mode. By default monitored workbooks are assumed to require automatic calc mode, and so the calc mode is changed to automatic if manual calc mode is detected
[global] No Set to TRUE to indicate that the workbook is open if any Excel instance has a lock on the file, even if the workbook is not open locally. By default monitoring will ensure that the workbook is running on the current machine even if it is already open on some other machine
[keyboard_shortcut] No If set to a valid keyboard shortcut sequence as supported by U.KEYBOARD_SHORTCUT (see doc related to that method), then if not already open the workbook will be launched when the specified keyboard combination or sequence is entered. Excel does not have to be open for the workbook to be launched with a specified keyboard shortcut
[voice_shortcut] No If set to a phrase as supported by U.LISTEN, then if not already open the workbook will be launched when the specified phrase is spoken into the computer's microphone. Excel does not have to be open for the workbook to be launched with a specified voice shortcut
[rebuild_calc_tree] No If set to TRUE then the a full recalc of the workbook with Excel's calc dependency tree rebuilt is performed when it is opened. This helps to prevent Excel from freezing/crashing at launch when it's calc dependency tree is corrupted
[prevent_sleep] No If set to TRUE then Windows is prevented from entering sleep mode

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.MONITOR_WORKBOOK("keep_me_up.xlsx")

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.