I have never used a Try-Catch before. I want to read some txt. files, but some may not exist. If file exist, the robot will extract some text from file and write the text to an Excel file.
I did a
Try : Read txt file
Catch Exception: “Syste.Aggregate Exception” then write a line that “File not found.”
Finally: Write extracted text to Excel
When I get Catch exception “File not found.”, it still move to Finally and write the previously extracted text into Excel.
I don’t to write any text into Excel if “File not found”.