PDF Creator hanging in Access
I am using the following code but Access seems to hang and flicker continuously until I kill it in task manager. Can someone advise what is wrong in the code? Thanks!
Public Sub PrintRep(RepName As String)
Dim PDFCreator1 As PDFCreator.clsPDFCreator, DefaultPrinter As String, c As Long, _
OutputFilename As String
Set PDFCreator1 = New clsPDFCreator
With PDFCreator1
.cStart "/NoProcessingAtStartup"
.cOption("UseAutosave") = 1
.cOption("UseAutosaveDirectory") = 1
.cOption("AutosaveDirectory") = "C:\Program Files\Leaps And Bounds"
.cOption("AutosaveFilename") = RepName
.cOption("AutosaveFormat") = 0 ' 0 = PDF
DefaultPrinter = .cDefaultPrinter
.cDefaultPrinter = "PDFCreator"
.cClearCache
DoCmd.OpenReport RepName, acViewNormal
.cPrinterStop = False
End With
c = 0
Do While (PDFCreator1.cOutputFilename = "") And (c