Use Delete Worksheet Rows to permanently remove one or more full rows from an existing .xlsx worksheet. Microsoft Excel shifts the rows below the deleted range up, and the step refuses to delete rows that intersect a structured Excel table.
Step Library: Microsoft Excel > Worksheet rows
When to use this step
Use this step when you want to:
- permanently remove one or more full worksheet rows at a known one-based position;
- shift all following worksheet content up by the number of deleted rows; or
- continue with the resolved workbook in following steps without changing workflow variables.
Common examples include:
- removing temporary import rows after their values have been processed;
- deleting an obsolete block from a report or worksheet; or
- compacting a worksheet after a process no longer needs selected rows.
Use Delete Table Row instead when the row belongs to a structured Excel table. Use Clear Range Contents when you want to keep the rows and remove only their values, or Update Worksheet Row when you want to replace values without shifting other rows.
Before you begin
- Create or select a Microsoft Excel connection that uses a Microsoft work or school account. The connection requires delegated
Files.ReadWritepermission. - Ensure the connected account can edit the target
.xlsxworkbook. - Confirm that the selected full rows can be permanently deleted. Flowifier does not restore deleted rows.
- Ensure the rows do not intersect a structured Excel table.
- If you use a Microsoft Excel Workbook Object, make it available as a workflow variable or as the Workbook output of an earlier step.
Configure the step
- Add Delete Worksheet Rows from Microsoft Excel > Worksheet rows.
- Select the step to open its configuration panel.
- Select the Microsoft Excel Connection.
- In Workbook source, select Microsoft 365 file, Workbook variable, or Drive and item IDs, then configure the displayed workbook settings.
- Select the Worksheet.
- Enter the one-based Starting row number and the Number of rows to delete, or select compatible Number variables.
- Save or publish the workflow.
Settings
| Setting | Required | Accepted values | Visible when | Description |
|---|---|---|---|---|
| Connection | Yes | Microsoft Excel connection | Always | Connection used to access Microsoft Graph. There is no default. The connection must be available to the workflow, remain authorized, and have write access to the workbook. |
| Workbook source | Yes | Microsoft 365 file, Workbook variable, or Drive and item IDs | Always | Selects how the workbook is identified. The default is Microsoft 365 file. |
| Workbook file | Yes | Selected .xlsx file or an Object variable with schema @microsoft/drive-item-reference@v1 | Workbook source = Microsoft 365 file | Supplies the workbook's drive and item identity. There is no default file. At runtime, the selected value or variable must resolve to an accessible .xlsx file. |
| Workbook variable | Yes | Object variable or step output with schema microsoft-excel/workbook@1 | Workbook source = Workbook variable | Supplies a workbook reference published by a previous Microsoft Excel step or stored in a compatible Object variable. There is no default. The resolved Object must contain non-empty Drive ID and Item ID values. |
| Drive ID | Yes | Fixed Text or Text variable | Workbook source = Drive and item IDs | Identifies the OneDrive for Business or SharePoint drive. There is no default. The resolved value must not be empty. |
| Item ID | Yes | Fixed Text or Text variable | Workbook source = Drive and item IDs | Identifies the .xlsx workbook within the selected drive. There is no default. The resolved value must not be empty. |
| Worksheet | Yes | Selected worksheet, fixed worksheet ID or exact name, or Text variable | Always | Identifies the worksheet to change. There is no default. The worksheet picker is available when the connection and workbook can be resolved while authoring. At runtime, the value must resolve to an existing worksheet reference. |
| Starting row number | Yes | Fixed whole Number or Number variable from 1 to 1,048,576 | Always | One-based first row to delete. There is no default. Fixed invalid values are rejected by Designer validation; variables are resolved and validated at runtime. |
| Number of rows | Yes | Fixed whole Number or Number variable from 1 to 1,048,576 | Always | Number of consecutive full rows to delete. The default is 1. Fixed invalid values are rejected by Designer validation; variables are resolved and validated at runtime. The final deleted row must not exceed row 1,048,576, and the requested rows must not intersect a structured table. |
Data and outputs
Workflow variable effects
This step does not modify workflow variables. It only reads selected variables when resolving its configuration.
Step outputs
| Step output | Type | Available when | Scope | Description |
|---|---|---|---|---|
| Workbook | Object — Microsoft Excel Workbook (microsoft-excel/workbook@1) | After successful completion | Following steps in the current workflow context until the execution path ends | Reusable reference to the resolved workbook after the rows are deleted. It always contains Drive ID and Item ID; Name and Web URL are included only when the selected input provides them. File selections and explicit drive and item IDs can therefore expose only the required IDs. It is not exposed when the step fails. |
The step has no output that describes the deleted rows or their former values.
Runtime behavior
Execution and completion
When the step runs, Flowifier:
- Resolves the selected connection, workbook, worksheet, starting row, and row count.
- Validates each row value and verifies that the final deleted row does not exceed row
1,048,576. - Opens a persistent Microsoft Excel workbook session.
- Reads the workbook's tables and their ranges to verify that the requested rows do not intersect a structured table.
- Requests deletion of the full rows and tells Microsoft Excel to shift following cells up.
- Exposes Workbook, then completes the step. The workbook session is closed on a best-effort basis.
Row deletion is a permanent, externally visible side effect. Deleted rows remain absent if a later workflow step fails. Running the step again deletes the rows that currently occupy the configured positions and shifts the current content up again; the operation is not idempotent.
Branches and child steps
This step does not have branches or child steps. When it is placed inside a branch or child-step context, its Workbook output follows that context's normal scope and does not escape the execution path on which it was created.
Failure, retry and resume behavior
This step does not suspend execution and has no resume point. Safe session setup and table-read requests may retry transient throttling or service errors before the deletion request is sent. The row-deletion request itself is not automatically retried.
If validation, authentication, permission, table-intersection, or provider validation fails before deletion, the step fails, exposes no step output, and the workflow does not continue along its normal execution path. Correct the configuration or provider state and start a new execution; a failed execution is not resumed.
Because row deletion is a mutation, a network interruption, timeout, or service failure after Microsoft Graph receives the request can leave the outcome unknown. The rows might already have been deleted even though the step failed. Inspect the workbook before starting another execution. Concurrent deletions in the same worksheet are independent provider requests and can shift row positions or produce a provider conflict.
Cancellation or termination cannot restore rows that Microsoft Graph has already deleted.
Errors and limits
| Situation | Result | Resolution |
|---|---|---|
| A required fixed setting is missing | Designer validation reports the affected setting and prevents a valid publish. | Complete Connection, the settings shown for the selected Workbook source, Worksheet, Starting row number, and Number of rows. |
A fixed row value is not a whole Number from 1 to 1,048,576 | Designer validation reports the invalid setting and prevents a valid publish. | Enter a supported whole Number for Starting row number and Number of rows. |
| A variable is missing, has the wrong type or Object schema, or resolves to an empty or invalid value | The step fails before deletion and reports the invalid input. No step output is exposed. | Ensure the variable exists, has the compatible type or schema, and resolves to a value accepted by its setting. |
The starting row plus the row count exceeds row 1,048,576 | The step fails before deletion, reports the row-count input, and leaves the workbook unchanged. | Reduce Starting row number or Number of rows so the full deleted range fits in the worksheet. |
| The requested full rows intersect a structured Excel table | The step fails with Full worksheet rows that intersect an Excel table cannot be inserted or deleted. The workbook remains unchanged. | Delete rows outside the table, or use Delete Table Row to remove a row from the table. |
| The workbook or worksheet does not exist, is inaccessible, protected, locked, or not a supported file | The step fails and exposes no step output. | Select an accessible, editable .xlsx workbook and an existing worksheet, remove protection or locks when appropriate, or correct the supplied IDs or names. |
| The connection is unavailable, expired, or lacks permission | The step fails without exposing connection credentials or provider details. | Reconnect Microsoft Excel, grant the required permission, confirm workflow access to the connection, and verify write access to the workbook. |
| Microsoft Graph throttles or cannot confirm the deletion result | Safe reads may retry, but the deletion request is not automatically retried. If the request was dispatched, the rows might already have been deleted. | Inspect the workbook first. If the rows remain, wait if necessary and start a new execution. |
| A successful configuration is executed again | The step deletes the rows that now occupy the configured positions and shifts the current content up again. | Design the workflow to prevent duplicate execution, or verify the workbook before deliberately rerunning the step. |
Example
Remove two obsolete report rows
Goal: Delete two obsolete rows from a worksheet and continue working with the same workbook.
Configuration:
- Connection:
Finance Microsoft Excel - Workbook source:
Microsoft 365 file - Workbook file:
Monthly close.xlsx - Worksheet:
Summary - Starting row number:
10 - Number of rows:
2
Result: Flowifier permanently deletes the current rows 10 and 11. The previous row 12 and all following worksheet content shift up by two rows. A following step can reuse the Workbook output. Running the same configuration again deletes the new rows 10 and 11.
Related information
- Insert Worksheet Rows — insert full worksheet rows and shift existing content down.
- Get Worksheet Row — read a worksheet row before deciding whether to delete it.
- Delete Table Row — remove one row from a structured Excel table.
- Clear Range Contents — remove cell contents without shifting worksheet rows.
- Update Worksheet Row — replace values in a worksheet row without shifting other rows.
- Microsoft Excel connections — connect a Microsoft work or school account and authorize workbook access.
- Microsoft Graph: Delete range — provider API behavior for deleting cells and shifting remaining content.
Comments
0 comments
Please sign in to leave a comment.