web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / How to use Power Autom...
Power Automate
Answered

How to use Power Automate to take data from one Excel spreadsheet and put it into another Excel Spreadsheet.

(0) ShareShare
ReportReport
Posted on by 25

Hello Power Automate Community

Good Day!

I'm looking for some documentation or videos that will show me how to automate this task.

 

Attachment:

 

Re: Screen Shot 2

Top section in orange excel file 1 - new data.

1) Launch Excel - Power BI Sample New Data

2) Read the data in tab - New Data

Bottom section in blue excel file 2 - old data.

3) Launch Excel - Power BI Sample Model

4) Replace/write the data from Excel File 1 - New Data tab into Excel File 2 - Update Tab.

5) Close Excel - Power BI Sample Model

 

Please advise if any questions.

Much appreciate your time. 

Thank you

Screen shot 1

PBICurious_1-1702326526458.png

Screen shot 2

PBICurious_2-1702327891149.png

 

 

I have the same question (0)
  • UshaJyothiKasibhotla Profile Picture
    225 Moderator on at

    YOU need to take the data from file 1 and you need to append to the file 2 right?

  • UshaJyothiKasibhotla Profile Picture
    225 Moderator on at

    Assuming that you need to append the data from file1 to File 2 

    I created the flow As shown in the image

    UshaJyothi20_3-1702358566472.png

     

    Please let me know if it was your requirement

    and the snippet of the code is below. copy and paste the code into your designer 

     

    Excel.LaunchExcel.LaunchAndOpenUnderExistingProcess Path: $'''C:\\Users\\cogni\\Downloads\\Power BI Sample New Data.xlsx''' Visible: True ReadOnly: False Instance=> ExcelInstance
    Excel.ReadFromExcel.ReadAllCells Instance: ExcelInstance ReadAsText: False FirstLineIsHeader: False RangeValue=> NewData
    Excel.LaunchExcel.LaunchAndOpenUnderExistingProcess Path: $'''C:\\Users\\cogni\\Downloads\\Power BI Sample Model.xlsx''' Visible: True ReadOnly: False Instance=> LaunchOldData
    Excel.ReadFromExcel.ReadAllCells Instance: LaunchOldData ReadAsText: False FirstLineIsHeader: False RangeValue=> ExcelData
    Excel.GetFirstFreeColumnRow Instance: LaunchOldData FirstFreeRow=> FirstFreeRow
    Excel.WriteToExcel.WriteCell Instance: LaunchOldData Value: NewData Column: $'''A''' Row: FirstFreeRow

     

     

    Hope this helps

    Usha.

     

  • UshaJyothiKasibhotla Profile Picture
    225 Moderator on at

    Assuming that you need to append the data from file1 to File 2 

    I created the flow As shown in the image

    UshaJyothi20_3-1702358566472.png

     

    Please let me know if it was your requirement

    and the snippet of the code is below. copy and paste the code into your designer 

     

    Excel.LaunchExcel.LaunchAndOpenUnderExistingProcess Path: $'''C:\\Users\\cogni\\Downloads\\Power BI Sample New Data.xlsx''' Visible: True ReadOnly: False Instance=> ExcelInstance
    Excel.ReadFromExcel.ReadAllCells Instance: ExcelInstance ReadAsText: False FirstLineIsHeader: False RangeValue=> NewData
    Excel.LaunchExcel.LaunchAndOpenUnderExistingProcess Path: $'''C:\\Users\\cogni\\Downloads\\Power BI Sample Model.xlsx''' Visible: True ReadOnly: False Instance=> LaunchOldData
    Excel.ReadFromExcel.ReadAllCells Instance: LaunchOldData ReadAsText: False FirstLineIsHeader: False RangeValue=> ExcelData
    Excel.GetFirstFreeColumnRow Instance: LaunchOldData FirstFreeRow=> FirstFreeRow
    Excel.WriteToExcel.WriteCell Instance: LaunchOldData Value: NewData Column: $'''A''' Row: FirstFreeRow

     

     

    Hope this helps

    Usha.

     

  • UshaJyothiKasibhotla Profile Picture
    225 Moderator on at

    Assuming that you need to append the data from file1 to File 2 

    I created the flow As shown in the image

    UshaJyothi20_3-1702358566472.png

     

    Please let me know if it was your requirement

    and the snippet of the code is below. copy and paste the code into your designer 

     

    Excel.LaunchExcel.LaunchAndOpenUnderExistingProcess Path: $'''C:\\Users\\cogni\\Downloads\\Power BI Sample New Data.xlsx''' Visible: True ReadOnly: False Instance=> ExcelInstance
    Excel.ReadFromExcel.ReadAllCells Instance: ExcelInstance ReadAsText: False FirstLineIsHeader: False RangeValue=> NewData
    Excel.LaunchExcel.LaunchAndOpenUnderExistingProcess Path: $'''C:\\Users\\cogni\\Downloads\\Power BI Sample Model.xlsx''' Visible: True ReadOnly: False Instance=> LaunchOldData
    Excel.ReadFromExcel.ReadAllCells Instance: LaunchOldData ReadAsText: False FirstLineIsHeader: False RangeValue=> ExcelData
    Excel.GetFirstFreeColumnRow Instance: LaunchOldData FirstFreeRow=> FirstFreeRow
    Excel.WriteToExcel.WriteCell Instance: LaunchOldData Value: NewData Column: $'''A''' Row: FirstFreeRow

     

     

    Hope this helps

    Usha.

     

  • PBI-Curious Profile Picture
    25 on at

    Hello Usha

    Sorry for the late response, I had been off the grid for a while. I will take a look at the flow and let you know if I have any question.

    Much appreciate your help!

    Thank you and Happy New Year

  • PBI-Curious Profile Picture
    25 on at

    Hello Usha

    Per my screen shot below, I need the New Data re: the file  on the top in the screen shot to move to the bottom file in the Update tab. I'm not certain if you pick that up in my instructions.

     

    Please advise 

    Thank you

    PBICurious_0-1704591749343.png

     

  • Agnius Bartninkas Profile Picture
    Most Valuable Professional on at

    As @UshaJyothi20 mentioned, their suggestion would work assuming you wanted to append the new data to existing data. But it seems like that is not the requirement. You want to overwrite existing data with new data, right?

     

    In which case, you can essentially do almost the same thing that Usha suggested, apart from the end of it, where you should write to row 2 (as row 1 is dedicated for column headers) instead of %FirstFreeRow%. And then you also need to delete any unnecessary data, if your new data is shorter than existing data. So, you might want to use Delete from Excel worksheet and delete the data within the range between %NewData.RowsCount+1% (where your new data ends) and %FirstFreeRow%.

     

    Here's what a flow like that should look like:

    Agnius_0-1704605200312.png

     

    And here's a snippet you can copy and paste directly into your PAD designer to have the actions created for you:

    Excel.LaunchExcel.LaunchAndOpenUnderExistingProcess Path: $'''C:\\RPA\\Power BI Sample New Data.xlsx''' Visible: True ReadOnly: False Instance=> ExcelInstance
    Excel.ReadFromExcel.ReadAllCells Instance: ExcelInstance ReadAsText: False FirstLineIsHeader: False RangeValue=> NewData
    Excel.CloseExcel.Close Instance: ExcelInstance
    Excel.LaunchExcel.LaunchAndOpenUnderExistingProcess Path: $'''C:\\RPA\\Power BI Sample Model.xlsx''' Visible: True ReadOnly: False Instance=> LaunchOldData
    Excel.GetFirstFreeColumnRow Instance: LaunchOldData FirstFreeColumn=> FirstFreeColumn FirstFreeRow=> FirstFreeRow
    Excel.WriteToExcel.WriteCell Instance: LaunchOldData Value: NewData Column: $'''A''' Row: 2
    Excel.DeleteCells.DeleteCells Instance: LaunchOldData StartColumn: $'''A''' StartRow: NewData.RowsCount + 1 EndColumn: FirstFreeColumn EndRow: FirstFreeRow ShiftCellsDirection: Excel.ShiftCellsDirection.Left
    Excel.SaveExcel.Save Instance: LaunchOldData
    Excel.CloseExcel.Close Instance: LaunchOldData
    

     

    Please note you will need to change the file paths in the Launch Excel actions.

    -------------------------------------------------------------------------
    If I have answered your question, please mark it as the preferred solution. If you like my response, please give it a Thumbs Up.

    I also provide paid consultancy and development services using Power Automate. If you're interested, DM me and we can discuss it.

  • PBI-Curious Profile Picture
    25 on at

    Hello Agnius

    Good Day!

    Yes, I want to overwrite existing data with new data. I will work with your code and review the output, then get back to you.

    Much appreciate your time.

     

    Thank you

     

  • PBI-Curious Profile Picture
    25 on at

    Hello Agnius

    I received the following error.

    Please advise next steps.

    Thank you

     

    PBICurious_0-1705005796971.png

     

  • Agnius Bartninkas Profile Picture
    Most Valuable Professional on at

    That is not the correct order of actions, and it's different from what I had sent you. You are trying to write to Excel before opening the Excel file. Make sure the second Launch Excel action is before the Write to Excel worksheet action.

         -------------------------------------------------------------------------

    If I have answered your question, please mark it as the preferred solution. If you like my response, please give it a Thumbs Up.

     

    I also provide paid consultancy and development services using Power Automate. If you're interested, DM me and we can discuss it.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 592

#2
Valantis Profile Picture

Valantis 340

#3
11manish Profile Picture

11manish 284

Last 30 days Overall leaderboard