How to convert Excel files to CSV files.(Power Automate Desktop)
Introduction to transcribing the contents of one worksheet in an Excel book to a CSV file.
This flow does the opposite of How to convert CSV files to Excel files.
This flow can be configured to support not only CSV, but also TSV, arbitrarily delimited files, and fixed-length formats.

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\\src.xlsx''' Visible: False ReadOnly: False Instance=> ExcelInstance
Excel.SetActiveWorksheet.ActivateWorksheetByName Instance: ExcelInstance Name: $'''Sheet1'''
Excel.GetFirstFreeColumnRow Instance: ExcelInstance FirstFreeColumn=> FirstFreeColumn FirstFreeRow=> FirstFreeRow
Excel.ReadFromExcel.ReadCells Instance: ExcelInstance StartColumn: 1 StartRow: 1 EndColumn: FirstFreeColumn - 1 EndRow: FirstFreeRow - 1 ReadAsText: False FirstLineIsHeader: False RangeValue=> ExcelData
Excel.CloseExcel.Close Instance: ExcelInstance
File.WriteToCSVFile.WriteCSV VariableToWrite: ExcelData CSVFile: $'''C:\\Test\\dst.csv''' CsvFileEncoding: File.CSVEncoding.UTF8 IncludeColumnNames: False IfFileExists: File.IfFileExists.Overwrite ColumnsSeparator: File.CSVColumnsSeparator.SystemDefault
Flow creation steps
Set up Excel Launch Action.
Parameter | Value |
---|---|
Launch Excel | and open the following document |
Document path | Path of the Excel file to be converted. |
Make instance visible | OFF |

Set up Set active Excel Worksheet Action.

Set up Get first free column/row from Excel worksheet Action.
There are no parameters to set if they are set up in the correct order.

Set up Read from Excel worksheet Action.
Parameter | Value | Remarks |
---|---|---|
Retreive | Values from a range of cells | |
Start column | 1 | 1 is the setting for conversion from the first column. Change as appropriate depending on the range to be converted to CSV. |
Start row | 1 | 1 is the setting for conversion from the first row. Change as appropriate depending on the range to be converted to CSV. |
End column | %FirstFreeColumn - 1% | |
End row | %FirstFreeRow - 1% | |
Get cell contents as text | OFF | On if you want to reflect formatting such as comma delimited. |
First line of range contains column names | OFF |

Set up Close Excel Action.

Set up Write to CSV file.
Parameter | Value |
---|---|
Variable to write | %ExcelData% |
File Path | Destination file path. |

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!