Can not create PDF with Filename per API


i got some issue to create a pdf via the api. I am using VB6

so the syntax is.

PDFPrinter.cOption("UseAutosave") = 1
PDFPrinter.cOption("AutosaveFormat") = 0    ' 0 = PDF
DefaultPrinter = PDFPrinter.cDefaultprinter
PDFPrinter.cDefaultprinter = "PDFCreator"
PDFPrinter.cOption("AutosaveDirectory") = pOutputPath
PDFPrinter.cOption("AutosaveFilename") = pOutputFileName
PDFPrinter.cPrinterStop = False

In some cases on a 64 bit os this code is not functional.

How can that be possible?