Sam Yeung Posted March 14, 2021 Share Posted March 14, 2021 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. Link to comment Share on other sites More sharing options...
Saurabh Jain Posted March 14, 2021 Share Posted March 14, 2021 Hi Sam A delay addon in between each step may be a quick trick to resolve the same Just see how much seconds manually printing take place and then just add delay say of 30 seconds to 1 minutes Hope that helps Regards Saurabh Link to comment Share on other sites More sharing options...
Recommended Posts