How to convert CSV files to Excel files.(Power Automate Desktop)
Introduction to transcribing a CSV file to an Excel file with its contents intact.
This flow does the opposite of How to convert Excel files to CSV 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.
File.ReadFromCSVFile.ReadCSV CSVFile: $'''C:\\Test\\test.csv''' Encoding: File.CSVEncoding.UTF8 TrimFields: True FirstLineContainsColumnNames: False ColumnsSeparator: File.CSVColumnsSeparator.SystemDefault CSVTable=> CSVTable
Excel.LaunchExcel.LaunchUnderExistingProcess Visible: False Instance=> ExcelInstance
Excel.WriteToExcel.WriteCell Instance: ExcelInstance Value: CSVTable Column: 1 Row: 1
Excel.CloseExcel.CloseAndSaveAs Instance: ExcelInstance DocumentFormat: Excel.ExcelFormat.FromExtension DocumentPath: $'''C:\\Test\\Result.xlsx'''

Flow creation steps
Set up Read from CSV file Action to specify the file to be read and its format.

Next, set up Excel Launch Action.
Parameter | Value |
---|---|
Launch Excel | with a blank document |
Make instance visible | OFF |

Next, set up a Write to Excel worksheet Action.
Parameter | Value |
---|---|
Value to write | %CSVTable% |
Write mode | On specified cell |
Column | 1 |
Row | 1 |

Finally, set up Close Excel Action and save the file.
Parameter | Value |
---|---|
Excel instance | %ExcelInstance% |
Before closing Excel | Save document as |
Dodument format | Default(From Extension) |
Dodument path | Destination file path. |

---
Discussion
New Comments
No comments yet. Be the first one!