How to prevent Uipath opening an Excel backup file

For some reason, one of my Excel files produces a backup file after saving. The backup file is the file with the ‘~’ sign at the start of the file name. For my automation, I’m trying to get Uipath to open up the file ‘nm24 masterfile.xlsx’ so I used an Assign activity to pick up any file which contains ‘masterfile’ in the description. Problem is, Uipath ends up opening the back up file (~$nm24 masterfile.xlsx) instead. Is there a way to get Uipath to stop opening the backup file? Perhaps if there’s a way to tell it to check if the file name contains either the ~ or $ sign and if yes, to not open it?

screenshot_mfile

Hi @kerri.tiam2

If you are using for each loop to open file one by one then,
inside for each use an if condition not Path.GetFileName(item.ToString).Contains(“~”)

image

1 Like

Thanks @prasath_S !! You saved my day :smiley:

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.