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 / Power Automate Desktop...
Power Automate
Unanswered

Power Automate Desktop - Merging/Appending 1,400 Excel Files

(0) ShareShare
ReportReport
Posted on by 10

I'm sure I'm not the first person to try this (maybe the dumbest??) so, perhaps someone can lend some guidance. I have many Excel workbooks in a local folder I need to merge into one Excel workbook. I've been struggling to complete this using Power Automate Desktop.

 

Has anyone done this? Can they provide some advice or examples?

 

Thanx in advance

 

Joe

I have the same question (0)
  • mattias1172 Profile Picture
    on at

    So long as your data is consistent or between columns on each spreadsheet, this should be relatively easy. 

     

    I'm only going to do a small "proof of concept" so there's not telling what kind of curve ball 1,400 files can have. 

     

    Basically, we want to get a list of all the files (with their fill paths), iterate through each one, copy the data, and paste to a new "appended" worksheet. If not already, make sure all the files are in the same directory to make this easier. 

     

    This initial setup is pretty simple. "Get Files in folder" to get a list of all the file paths.

    mattias1172_0-1648142759736.png

    "Launch Excel" with blank document to append all the data to. 

    mattias1172_1-1648142808798.png

    A "For Each" loop iterating over the variable "Files" we created in the first step. This will give us the individiaul file paths for iteration. 

    mattias1172_2-1648142865949.png

    Inside the loop, our first step is to get the first free row of the new document we are creating. This is to make sure we don't overwrite any data. 

    mattias1172_3-1648142924440.png

    Next a second launch excel now opening the current existing file we want the data from.

    mattias1172_4-1648142974573.png

    We then want to read the data inside. This action has an additional option we can select if your files have headers. If so, check off the "First line...." slider under "Advanced"

    mattias1172_5-1648143031989.png

    Next we write the data to our new appended file. We start on the A column and for row, grab our variable from the "Get first free row" action.

    mattias1172_6-1648143081085.png

    Last, we close the current existing excel file. 

    After the loop, add a second close excel with the option to save the document with a path and name. 

    mattias1172_7-1648143151326.png

     

    Here is the data in the spreadsheets:

    mattias1172_8-1648143186655.png

    mattias1172_9-1648143214265.png

     

    And the final result:

    mattias1172_10-1648143237252.png

     

    Full Flow:

    mattias1172_0-1648143417669.png

     

  • MichaelAnnis Profile Picture
    5,727 Moderator on at

    Personal Opinion:  PAD will take forever to do this by itself.  I have attached a Macro Workbook that was created specifically for this purpose.  It assumes that all columns in each workbook are fixed and that each workbook you have has a title row (so data starts at row 2).  In short, the macro reads the list of files in Column A&B (you can use PAD to write them - see below) and combines them all to a single file specified in E2 and F2.

     

    MichaelAnnis_0-1648148601904.png

     

    So, start by opening the file and making sure macros are enabled.  Update your output path in E2 and you output filename in F2, save and close this file.

     

    Then, all PAD needs to do is:

    MichaelAnnis_2-1648149292031.png

    Good luck!

     

  • Alphadrag Profile Picture
    164 on at

    Hi, may i ask where did you get the "Current_Excel_File" from?

     

  • mattias1172 Profile Picture
    on at

    Current_Excel_File is the Excel instance opened within the For Each loop. It's created by the "Launch Excel" action inside the loop. 

  • UK_Mike Profile Picture
    on at

    I can only presume its 1 sheet per workbook.

    Power Query will easily combine all these books plus anytime a new workbook gets dropped into the folder its just a matter of refreshing the query, will do it in milliseconds 

    Me personally keep PAD out of the equation or just use it to refresh the query.

  • pawlowski6132 Profile Picture
    10 on at

    Thanx much for all the time you took to answer this. I'm going to give this a whirl and see if it candle my workload.

  • pawlowski6132 Profile Picture
    10 on at

    Hi. This might work too. I'm going to work on this today using this Macro. I'll let you know how it worked out.

  • pawlowski6132 Profile Picture
    10 on at

    Good question. So, the Excel Workbooks are output from running an SAP Transaction/report and reside on a shared file server on our corp network.

  • pawlowski6132 Profile Picture
    10 on at

    Actually, it's three sheets per workbook but, I only need one. 

  • mattias1172 Profile Picture
    on at

    If you do end up using PAD for this, i would recommend disabling the option to visibly open the workbook in the "Launch Excel" action. This will prevent you from seeing what PAD is doing, but will make it process a little faster. Since were talking in the 1,000+ range, this may help. 

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 247 Super User 2026 Season 2

#2
11manish Profile Picture

11manish 164 Super User 2026 Season 2

#3
trice602 Profile Picture

trice602 138 Super User 2026 Season 2

Last 30 days Overall leaderboard