Hi,

I have a problem with new version of pdfCreator v2.0.2 and Excel VBA.
Some years ago I used a VBA script for Excel 2003 for print a sheet in pdf through pdfCreator.
Up to pdfCreator v1.7.3 all worked fine but when I installed new 2.0.2 version, the script not works.

Excel give me an error on command:
Code:
Set pdfjob = CreateObjec("PDFCreator.clsPDFCreator")
with this message:
Code:
run-time error '429':
ActiveX component can't create object
Now I unable to use my Excel sheet.

I know the PDFCreator and the COM interface were completely rewritten but now I not understand How to rewrite the script to work with new version.

This is my old code:
Code:
Sub STAMPA_ORE()

    Dim pdfjob As Object
    Dim sPDFName As String
    Dim sPDFPath As String
     
    Sheets("RENDICONTO_ORE").Select


    sPDFName = Range("INSERIMENTO_DATI!F2").Value & "_" & Range("INSERIMENTO_DATI!I2").Value & ".pdf"
    
    sPDFPath = Environ("USERPROFILE") & "\Documenti\Schede_Ore\"
     
    If IsEmpty(ActiveSheet.UsedRange) Then Exit Sub


    Set pdfjob = CreateObject("PDFCreator.clsPDFCreator")


    With pdfjob
        If .cStart("/NoProcessingAtStartup") = False Then
            MsgBox "Non posso far partire PDFCreator.", vbCritical + _
            vbOKOnly, "PrtPDFCreator"
            Exit Sub
        End If
         
    .cOption("UseAutosave") = 1
    .cOption("UseAutosaveDirectory") = 1
    .cOption("AutosaveDirectory") = sPDFPath
    .cOption("AutosaveFilename") = sPDFName
    .cOption("AutosaveFormat") = 0    ' 0 = PDF
    .cClearCache
    End With


    ActiveSheet.PrintOut Copies:=1, ActivePrinter:= _
    "PDFCreator su LPT1:", Collate:=True
    


    Do Until pdfjob.cCountOfPrintjobs = 1
        DoEvents
    Loop
    pdfjob.cPrinterStop = False


    Do Until pdfjob.cCountOfPrintjobs = 0
        DoEvents
    Loop
    pdfjob.cClose
    Set pdfjob = Nothing
    
    Sheets("INSERIMENTO_DATI").Select
    
End Sub
How I can resolve this?

Thanks,