Please see attachment. In the directory, there is 22274.xlsx and 22273.xlsx.
But there are no 12345.xlsx, 45678.xlsx and 56789.xlsx For now, the robot shows the 2 excel files that exist and ends the execution with NO error. I’d like the robot to return 12345, 45678 and 56789 when the excel file(s) is/are not found. Can you please give me some hint? Thanks!
I understand what you are saying and tried the PathExists method, but I am really not sure where to put the PathExists.
I assigned detailPath = Directory.GetFiles("\Uipath\Detail\detail-drop", item + “*.xlsx”)
Then for each item in detailPath
PathExist is true or not. If it’s true, do somethin as in the attached xaml above.
The execution has been ended by itself as the first instance does NOT exists.
My question is, when I assign detailPath as Directory.GetFiles, it has to be existed in order to get it right?
So I now first assign a string = “\Detail\detail-drop” + item + “*.xlsx”