Extract PDF Page Range: The process cannot access the file because it is being used by another process

Extract PDF Page Range: The process cannot access the file because it is being used by another process.


Notes:
UiPath is the only program open
This is for pdf files in a folder that may have anywhere from 1 to 5 pages but I want to keep only the 1st page
Main.xaml (8.9 KB)

Hi @Jonnathan_Fernandez ,

Could you maybe check how the outputFilePath variable is configured, I believe each time the same output file is getting replaced with a newer file page range and hence the error.

Maybe the outputFilePath value need to be dynamic so that the page extraction could be saved separately for each page range.

Hi @Jonnathan_Fernandez,

You’ve used the ‘file’ variable both as a path within a for and accessed it from outside the body scope, which could potentially be causing the issue. To investigate it in more detail, could you please share the workflow?

Regards,
MY

of course. Here you go
Main.xaml (8.9 KB)

You can’t do this:

You’re overwriting the value that’s in the file variable coming from the loop. file (the variable coming from the loop) already contains the full path and filename of the file. Just take out the Assign.

I took out the Assign however the issue remains the same. The issue itself is with the Extract PDF Page Range part

That’s because something else has the file open, as the error message says.

UiPath is the only program open. I restarted my pc a few times

Is the file on a network share? Someone else could have it open. Antivirus could have the file locked. If it’s a OneDrive or similar type of storage, that process could have the file locked.

The files are directly saved on my pc, not on the cloud. I have the standard Windows Virus that comes with Windows 10 but it doesn’t seem to have the file(s) locked