File Related Error when looping through Excel Files in a folder

162 Views Asked by At

I'm fairly new to PAD, but I've started receiving an error when my process runs on a VDI.

The error is:

enter image description here

I can tell that the file causing the error is a temporary file being created. I think I need the loop to skip over any temp files. I've tried adding an IF statement to skip over temp files, but it doesn't seem to be identifying the file and skipping it as intended. My flow will error and end.

Any help would be appreciated.

Here is a section of my code in PAD - the error occurs on line 18: enter image description here

EDIT: Additional Info The error occurs on line #18 - "Launch Excel" The temp Excel files do not exist in the folder when the process begins. They are being created during the PAD run.

1

There are 1 best solutions below

2
On

You can access the filename directly from the current item in the loop, in your case itm_ProcessTransactions_CurrentFile and check if it starts with ~$ if it does skip to the next item in the loop.

skipitem

the If statement:

ifstatement

or alternatively you could set the if statement to only continue when the filename does not start with ~$

notstartwith

or you could replace both IF statements with something like: bothifinone

ifreplaced