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 / Loop over several Exce...
Power Automate
Answered

Loop over several Excel files

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi all,

I'm trying to build a flow in PAD that updates 16 different excel files. The general idea of the flow is to

1) Collect input from the user regarding what period the report should be for

2) Open the first excel file and unprotect it

3) Open Power query editor and update the parameters asked for as input

4) Refresh all data

5) Protect the workbook again

6) Close the excel file

7) Open the next file and run through steps 2-6

 

I have managed steps 1-6. However, it seems like the UI elements cannot be re-used - new UI elements have to be created for each file since the newly opened file is considered by PAD to be a new window. It would of course be possible to capture all UI elements for all files and just repeat all actions for each file in a separate subflow. But it would be neater to loop through the steps and re-use UI-elements. 

 

Is this possible to achieve?

 

Best regards,

Erik

 

I have the same question (0)
  • Verified answer
    Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi

    You can reuse your selectors by editing the window selector for Excel. As a default, it will give it a name attribute. This is how it looks like when I have just opened and empty Excel instance: :desktop > window[Name="Mappe1 - Excel"][Process="EXCEL"].

    Your can edit this, and eg. put in a variabel that holds the woorkbook name (:desktop > window[Name="%WorkbookName%"][Process="EXCEL"], remove the name-attribute, or if part of the name is generic, you can use that.

     

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Thanks Rikke - that did the trick!

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 June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
11manish Profile Picture

11manish 223

#2
David_MA Profile Picture

David_MA 210 Super User 2026 Season 1

#3
Haque Profile Picture

Haque 175

Last 30 days Overall leaderboard