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 Automate
Unanswered

Excel Loop Error

(0) ShareShare
ReportReport
Posted on by

I have a flow that is based on a loop which opens an excel file in a particular folder directory, runs a macro on the open excel instance (to find and replace a list of keywords), closes excel, and then moves onto the next excel file in the directory. This works pretty well and cycles through a long list of files I have. However, if an excel file fails to launch properly (for whatever reason), this causes an error which terminates the flow.

 

Is there a way for me to just ignore any file that doesn't open correctly (and for that matter an error for any reason) and move on to the next file in the directory (i.e. so the flow works through every file and only skips those which cause an error). Ideally I'd get a list of the files that hadn't been processed, though this would just be a bonus.

 

Thanks

I have the same question (0)
  • ryule Profile Picture
    929 Super User 2024 Season 1 on at

    Have you tried using On Block Error?

     

    ryule_0-1658346031928.pngryule_1-1658346050868.png

     

  • VJR Profile Picture
    7,635 on at

    You can use the in-action error functionality of every action.

    For example, Launching the Excel has its own set of Error Handlers

     

    Refer the Advanced section:

     

    VJR_0-1658375900066.png

     

    Under the New rule button you can set a Flag variable. For Eg 1 if error and 0 if no error.

    Enable "Continue Flow run" and select "continue next action"

    Immediately after, have an If statement which will check this Flag value.

    If 1 then add this file name to a List variable, that way you will also have a list of Excel files that failed.

     

    Sometimes some error handlers do not capture specific types of errors. In that case encapsulate it with a on block error just like @ryule has suggested.

     

     

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
David_MA Profile Picture

David_MA 246 Super User 2026 Season 1

#2
11manish Profile Picture

11manish 176

#3
Haque Profile Picture

Haque 157

Last 30 days Overall leaderboard