PDF conversion, almost done

  • Thread starter Thread starter gitcypher
  • Start date Start date
G

gitcypher

I just finished writing the macros to print pdfs from my workbook. Th
last "line" of code is to use acrobat distiller to create the pdfs
During the macro, each sheet prints itself to a post script file, then
they are all compiled together (using distiller) to create on
invoicing package pdf. After that has completed, I would like to delet
the post script files, as well as the log file that is created whe
distiller runs.
I'm able to delete the files fine using
Kill (Range("NameFolder").Value & "\PDFs\*.ps")
Kill (Range("NameFolder").Value & "\PDFs\*.log")
Unfortunately, the computer is moving faster then distiller, in tha
the code is unable to delete the files because they are still in use.
I've added...
Application.Wait TimeSerial(Hour(Now()), Minute(Now()), Second(Now())
7)
before the kill commands, but that varies with each computer, eve
mine! Yesterday, it took about 6 seconds to distill all 8 or so sheets
Today, I booted up fresh, and the 7 seconds didn't allow enough time.
Is there something conceptually similar to...
ReturnValue = 999
DistillerCall = Range("AcroFName").Value & " /n /q /o" & PDFFileName
" " & PSFileName
Do
ReturnValue = Shell(DistillerCall, vbNormalFocus)
Application.Wait TimeSerial(Hour(Now()), Minute(Now()), Second(Now())
.5)
Loop Until ReturnValue <> 999

-Gitcyphe
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

PDF help! 2
File creation wait timer 23
Always Sendkeys... 3
Automated Print from Excel to PDF 2
Run Macros 11
Print to PDF using Adobe Acrobat 6.0 2
Automated Printing 2
Excel sheet to PDF Macro = security question 4

Back
Top