Set Range
Writes a table of data to a range of cells starting from a specified cell.
Common Properties
- Name - The custom name of the node.
- Color - The custom color of the node.
- Delay Before (sec) - Waits in seconds before executing the node.
- Delay After (sec) - Waits in seconds after executing the node.
- Continue On Error - Automation will continue regardless of any error. The default value is false.
info
If ContinueOnError property is true, no error is caught when the project is executed even if the Catch node is used.
Input
- File Descriptor - File descriptor of the Excel file. This is the identifier returned by the Open Excel node.
- Start Cell - Starting cell address where the data will be written (e.g.,
A1,B5). - Range - Table object containing the data to write. Must have
columnsandrowsproperties (same structure as Get Range output).
Output
This node has no output.
Options
- Headers - Whether to match columns by header names. Default is
false.false- Writes data sequentially starting from Start Celltrue- Matches table columns with existing headers in the first row and writes data to the correct columns
Example
Writing data without header matching:
// File Descriptor: message.excel_fd
// Start Cell: "A1"
// Range: message.table
// Headers: false
// Data is written starting at A1, filling columns and rows sequentially
Writing data with header matching:
// Excel sheet has headers: Name, Age, City, Score in row 1
// Start Cell: "A2" // Start writing from row 2
// Range: message.table (with columns: Name, Age, City, Score)
// Headers: true
// Data is matched to corresponding columns by name
Copying data between sheets:
// 1. Get Range from Sheet1
// Output: source_data
// 2. Activate Sheet2
// 3. Set Range to Sheet2
// Start Cell: "A1"
// Range: message.source_data
Appending data to existing sheet:
// Find last row with data first
// Then Set Range
// Start Cell: "A10" // Start after existing data
// Range: message.new_data
Tips
- The Range input must be a table object with
columns(array of strings) androws(array of objects). - When Headers is
true, the node looks for matching column names in row 1 and writes data to those specific columns. - When Headers is
false, data is written sequentially regardless of column names. - The output from Get Range can be directly used as input here.
- Large datasets are written efficiently in bulk for better performance.
Common Errors
| Error | Solution |
|---|---|
| Start Cell cannot be empty | Provide a starting cell address (e.g., A1) |
| Range cannot be empty | Provide a table object with data to write |
| Invalid File Descriptor | Ensure the Open Excel node was executed first |
| Error processing column | Verify table structure has valid columns and rows arrays |
| Column not found in headers | When Headers is true, ensure column names match those in row 1 |