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
Have you tried using On Block Error?
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:
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.