Hi
I'm trying to automate the printing of PDF's and after going round in circles with acrobat solutions, I the PDF creator code here and it worked great until I changed a variable and it's now getting stuck in a loop
Originally the code was something like
Code:
'/// Change the output file name here! ///
sPDFName = "example.pdf"
sPDFPath = ActiveWorkbook.Path & Application.PathSeparator
Which I've changed to:
Code:
'/// Change the output file name here! ///
sPDFName = Sheets("Invoicer").Range("D5")
sPDFPath = ActiveWorkbook.Path & Application.PathSeparator & "Invoices/"
Which works, the pdf is printed in the right directory and with the right name, however it now gets stuck here
Code:
'Wait until the file shows up before closing PDF Creator
Do
DoEvents Loop Until Dir(sPDFPath & sPDFName) = sPDFName
And it's a little beyond my skills as to why (it's probably very simple).
If anyone could help I'd really appreciate it.
Thanks
Jon
Bookmarks