Get Sheets
Retrieves a list of all sheets in the workbook, optionally including detailed metadata.
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.
Output
- Sheets - List of sheet names or sheet metadata objects, depending on the Show Metadata option:
- If Show Metadata is
false: Array of sheet names (e.g.,["Sheet1", "Sales", "Summary"]) - If Show Metadata is
true: Array of objects withIndex,SheetName, andDimensionproperties
- If Show Metadata is
Options
- Show Metadata - Whether to include detailed metadata for each sheet. Default is
false.false- Returns only sheet names as a simple arraytrue- Returns detailed information including index, name, and used range dimension
Example
Getting sheet names:
// File Descriptor: message.excel_fd
// Show Metadata: false
// Output: ["Sheet1", "Data", "Summary"]
Getting detailed sheet information:
// File Descriptor: message.excel_fd
// Show Metadata: true
// Output: [
// { Index: 1, SheetName: "Sheet1", Dimension: "A1:D10" },
// { Index: 2, SheetName: "Data", Dimension: "A1:Z100" },
// { Index: 3, SheetName: "Summary", Dimension: "A1:E5" }
// ]
Iterating through all sheets:
// 1. Get Sheets
// File Descriptor: message.excel_fd
// Output: sheets
// 2. Loop through sheets
// Use a For Each node with message.sheets
// 3. Inside loop, activate each sheet
// Sheet Name: message.item
Finding the sheet with the most data:
// Get Sheets with metadata
// Show Metadata: true
// Then use JavaScript to find the largest dimension
Tips
- Use Show Metadata when you need to know the used range of each sheet.
- The
Dimensionproperty shows the range of cells with data (e.g., "A1:D10"). - Sheet indices are 1-based and reflect the order of sheets in the workbook.
- This is useful for discovering sheet names dynamically in automated workflows.
Common Errors
| Error | Solution |
|---|---|
| Invalid File Descriptor | Ensure the Open Excel node was executed first |
| Workbook has no sheets | This should not occur as Excel workbooks always have at least one sheet |