Jump to content
Business Intelligence & Analytics for Digital Transformation

Power Automate Desktop: Cannot rename file in a print loop


Sam Yeung
 Share

Recommended Posts

I am trying to convert different files (Word, Excel) in a folder to PDF files ("interim pdf files") and then merge them into one PDF file.  In order to do this, I will select all Word documents, and Excel documents, and run through them in separate loops to convert to interim pdf files via PDF Printer. 

Take the Word loop as an example:

To ensure the same UI window name, I will rename each Word document (currentitem) to ToPrint.docx, and then print ToPrint.docx to PDF Printer, and then populate the "save as" with the original document directory and name followed by ".pdf".  

The issue I am encountering is: The loop will go through first run ok, but during the 2nd run, I receive an error message that I cannot rename the 2nd file because ToPrint.docx is used by another process.  

I have also added a wait for 60 seconds just in case the previous process takes longer time.  However, I still get the same error.

Many thanks.

1705513556_Screenshot2021-03-14120252.png.38e5949eb781a07897e345aca4585f71.png575101227_Screenshot2021-03-14120336.png.46b5121fc365803d9055e3da48c6c4bf.png

Link to comment
Share on other sites

 Share

×
×
  • Create New...