Insert empty rows in Excel worksheet, one row at a time.(Power Automate Desktop)
Introduce a Flow to insert blank lines one at a time.

Overall view of Flow

Robin(for copy and paste)
It can be copied and pasted into Power Automate Desktop.
Excel.LaunchExcel.LaunchAndOpenUnderExistingProcess Path: $'''C:\\Test\\Test.xlsx''' Visible: False ReadOnly: False Instance=> ExcelInstance
Excel.SetActiveWorksheet.ActivateWorksheetByName Instance: ExcelInstance Name: $'''Sheet1'''
Excel.GetFirstFreeColumnRow Instance: ExcelInstance FirstFreeColumn=> FirstFreeColumn FirstFreeRow=> FirstFreeRow
LOOP LoopIndex FROM FirstFreeRow TO 3 STEP -1
Excel.InsertRow Instance: ExcelInstance Index: LoopIndex
END
Excel.CloseExcel.CloseAndSave Instance: ExcelInstance
Flow creation steps
Set up a Launch Excel Action.
Parameter | Value |
---|---|
Launch Excel | and open the following document |
Document path | Path of the target Excel book. |
Make instance visible | OFF |
Open as ReadOnly | OFF |

Set up a Set active Excel Worksheet Action.
Parameter | Value |
---|---|
Active worksheet with | Name |
Worksheet name | The name of the target sheet. |

Set up a Get first free column/row from Excel worksheet Action.

Set up a Loop.
Add rows from the top, because the number of rows changes and it doesn't work properly. Therefore, we will add rows from the bottom.
Parameter | Value |
---|---|
Start from | %FirstFreeRow% |
End to | 3 |
Increment by | -1 |

Set up a Insert row to Excel worksheet Action in Loop.
Parameter | Value |
---|---|
Row index | %LoopIndex% |

Finally, set up Close Excel Action and save the file.
Parameter | Value |
---|---|
Before closing Excel | Save document |

Executing this flow inserts one blank line at a time.


For those who want to learn Power Automate Desktop effectively
The information on this site is now available in an easy-to-read e-book format.
Or Kindle Unlimited (unlimited reading).

You willl discover how to about basic operations.
By the end of this book, you will be equipped with the knowledge you need to use Power Automate Desktop to streamline your workflow.
Discussion
New Comments
No comments yet. Be the first one!