Insert Row
Inserts one or more blank rows into an Excel worksheet at a specified position. Existing rows below are shifted down.
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 the worksheet to insert rows into. Default is "Sheet1".
- Row Index - Row position where insertion starts (1-based). Existing rows at this position and below shift down.
Options
- Credentials - OAuth2 credentials (optional, alternative to using Client ID).
- Shift Direction - Direction to shift existing rows. Default is "Down".
- Insert Count - Number of blank rows to insert. Default is 1.
Output
- Success - True if rows were inserted successfully.
- Inserted Row Index - Starting row index where insertion occurred.
- Rows Inserted - Total number of rows inserted.
Examples
Insert Single Row:
// Input
Row Index: 5
Insert Count: 1
// Inserts 1 blank row at position 5
// Previous row 5 becomes row 6
Insert Multiple Rows:
// Input
Row Index: 10
Insert Count: 3
// Inserts 3 blank rows starting at position 10
Use Cases
- Add space for new data in existing worksheets
- Insert rows between existing data
- Prepare worksheets for dynamic data insertion
- Create gaps in data for organization
Tips
- Row index is 1-based (first row is 1)
- Inserted rows are blank - use Set Range or Set Cell Value to populate them
- Formulas in cells below are automatically adjusted
- For inserting and populating data, consider using Set Range with appropriate positioning
Common Errors
ErrInvalidArg - "Row Index must be greater than 0"
- Solution: Provide a valid row index (1 or greater)
ErrInvalidArg - "Workbook Id cannot be empty"
- Solution: Ensure you've called Get Workbook first
ErrGraph - "Failed to insert row"
- Solution: Verify you have write permissions and the worksheet exists