Skip to content
REFERENCE

U.WRITE_FILE

Summary

Writes data to the specified file

Syntax

=U.WRITE_FILE(filepath, data, [quotes], [delimiter], [do_not_overwrite], [as_displayed], [block])

Parameters

Parameter Required Description
filepath Yes The path of the file to which data will be written. If only a filename is provided, the directory of the current workbook is used. Precede with "[require_dir]" to only write file if directory already exists
data Yes The data to be written to the file
[quotes] No The handling of double quotes applied in the written file. Supported values are "As Needed" (default), "Strings", "All" and "None". If writing an Excel file, use this parameter to pass any custom tab names
[delimiter] No The string used to separate fields in a row. Default is a comma if not specified. Set to "tab" to create a tab-delimited file
[do_not_overwrite] No Set to TRUE to only write file if it does not already exist. Set to Append([num_label_rows],[force]) to append to file if it already exists. Set to Delete to delete the file if it exists (data parameter is ignored when deleting)
[as_displayed] No Set to TRUE to have values written to file as displayed in Excel. Include 2 columns with first set to TRUE and 2nd to FALSE to write values as displayed except retain full precision of numbers. Default is to write raw data to file. For image types saves image in range to file if set to TRUE.
[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.WRITE_FILE(C4,B7:C9)
=U.WRITE_FILE(C39,(B45:C46,B51:C51),C41,,"append(1)")
=IF(C18,U.WRITE_FILE(C32,C29),"not ready")

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.