Creating a while loop to check if there is an available spreadsheet

Hi I am having issues using a while loop to check if there is an available spreadsheet.We do not want to modify the spreadsheet but just want to check if there is a way to do it.

Attached is the workbook
image

@mohamad_ibrahim_Shah