jonrouston
New member
- Joined
- May 25, 2012
- Messages
- 2
- Reaction score
- 0
- Points
- 0
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
Which I've changed to:
Which works, the pdf is printed in the right directory and with the right name, however it now gets stuck here
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
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
Code:
'/// Change the output file name here! ///
sPDFName = Sheets("Invoicer").Range("D5")
sPDFPath = ActiveWorkbook.Path & Application.PathSeparator & "Invoices/"
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
Last edited: