Get Worksheet
Retrieves information about worksheets in an Excel workbook. Returns details about a specific worksheet or the first worksheet if no name is provided.
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 node.
- Continue On Error - Automation will continue regardless of any error. The default value is false.
info
If the ContinueOnError property is set to true, no error is caught when the project is executed even if a Catch node is used.
Input
- Client Id - The client ID from the Connect node (optional if using direct credentials).
- Workbook Id - The workbook ID from Get Workbook or Create Workbook node.
- Worksheet Name - Name of a specific worksheet to get information for. Leave empty to get the first worksheet.
Options
- Credentials - OAuth2 credentials (optional, alternative to using Client ID).
Output
-
Worksheet Info - Object containing worksheet details:
Id: Worksheet IDName: Worksheet namePosition: Position in the workbook (0-based)Visibility: Worksheet visibility (visible, hidden, veryHidden)UsedRange: Information about the used range (if data exists):Address: Range address (e.g., "A1:D10")RowCount: Number of rows with dataColumnCount: Number of columns with data
-
All Worksheets - Array of all worksheets in the workbook with basic information (Id, Name, Position, Visibility).
Examples
Get First Worksheet:
// Input
Client Id: ${client_id}
Workbook Id: ${workbook_id}
Worksheet Name: "" // Empty to get first sheet
// Output - worksheet info
{
"Id": "worksheet-id-123",
"Name": "Sheet1",
"Position": 0,
"Visibility": "visible",
"UsedRange": {
"Address": "Sheet1!A1:D10",
"RowCount": 10,
"ColumnCount": 4
}
}
Get Specific Worksheet:
// Input
Worksheet Name: "Sales Data"
// Returns information about the "Sales Data" worksheet
List All Worksheets:
// Output - worksheets array
[
{ "Id": "id1", "Name": "Sheet1", "Position": 0, "Visibility": "visible" },
{ "Id": "id2", "Name": "Data", "Position": 1, "Visibility": "visible" },
{ "Id": "id3", "Name": "Archive", "Position": 2, "Visibility": "hidden" }
]
Use Cases
- Discover available worksheets before processing
- Verify a worksheet exists before operations
- Get worksheet dimensions (used range)
- List all sheets for user selection
- Check worksheet visibility status
Tips
- Leave Worksheet Name empty to get the first worksheet automatically
- Use the All Worksheets output to discover available sheets
- The UsedRange property shows where data exists - useful for determining read boundaries
- Position is 0-based (first sheet is position 0)
- Worksheet names are case-insensitive when searching
Common Errors
ErrInvalidArg - "Workbook ID cannot be empty"
- Solution: Ensure you've called Get Workbook first and passed the workbook_id
ErrNotFound - "Worksheet not found"
- Solution: Verify the worksheet name is correct. Use Get Worksheet without a name to see all available worksheets