Normally Try Catch activity is used to catches a specified exception type in a sequence or activity, and either displays an error notification or dismisses it and continues the execution.
In your case i believe you need to check for a file and if the file is not available you have to terminate workflow.
Use “If” Activity with File.Exists(File Path in double quotes) example:(File.Exists(“C:\Users\MYDrive\Downloads\RPA.pptx”))
in the else part you can call terminate workflow activity
Hi, Thank you for your reply.
First, I will show you your misunderstanding…
I did not intended to check file exists, but I intended to check file was opened or not instead.
Pls advise me under this circumstances.
From the screenshot it looks like you are checking for an excel file. Use read workbook activity inside a try catch block. Workbook activity will throw an error if the file is already opened.
in the catch section defile system.exception then log and terminate as you like.