Hi, after running my workflow and attempting to overwrite the existing output file, I have encountered the error "File was is being used by another process" because I mistakenly left the file open while the workflow was running. After having done this many times, I was wondering if it would be possible to pause the workflow if the output file is being used by another process, and resume with writing the file after it has been closed.
Solved! Go to Solution.
This is so frustrating! There is a fairly easy solve to it. Stop writing to Excel!
Ok, that was fun to write. But here's another thought for you: Write it to a temporary file with a UNIQUE name too (yxdb). If for some reason your output to the "existing" file is not permitted, you can still have the data ready for you to overwrite the output file with.
There are enhancements that you can make to this approach. You could also use the CReW runner macros and first open the output files. If you open them without error, then you can run the real workflow. If the open fails, then you know that before you actually try to output to them.
Cheers,
Mark
Can you start from the temp yxdb to copy in excel after the first one has finished?
thanks
I am encountering a similar issue, but with yxdb file as the output. The workflow is run through CRew macros, where the first stage reads from SQL server and outputs to a temporary holding yxdb file. The workflow runs every 2 hours via a scheduler. The workflow aborts once in a while with the following error message, but then clears itself in a subsequent run:
Error creating the file " ..\Plan QRF Actuals Forecast Holding.yxdb ": The process cannot access the file because it is being used by another process
I haven't been able to figure out what is causing the issue.
suggest check this thread: