Code don't work for PDFcreator

Hi,

The code below :

After execute "Set pdfjob = CreateObject("PDFCreator.clsPDFCreator")" the value is TRUE
and after execute "With pdfjob" the value is FALSE.
How is this possible?
Tx

    Shell "taskkill /f /im PDFCreator.exe", vbHide
    Set pdfjob = CreateObject("PDFCreator.clsPDFCreator")
    With pdfjob
        If .cStart("/NoProcessingAtStartup") = False Then
            MsgBox "Can't initialize PDFCreator.", vbCritical + vbOKOnly, "PrtPDFCreator"
            Exit Sub
        End If
        .cOption("UseAutosave") = 1
        .cOption("UseAutosaveDirectory") = 1
        .cOption("AutosaveDirectory") = PDFpath
        .cOption("AutosaveFilename") = PDFnaam
        .cOption("AutosaveFormat") = 0    ' 0 = PDF
        .cClearCache
    End With
sonmicAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
What value? Do you mean that pdfJob is not created correctly? Or that the cStart method returns False?

If it does, then I'd suspect a problem with the installation of PDFCreator. Try removing and reinstalling.

Have you tried commenting out the Shell line? I'm not sure why you'd need that anyway. Generally you would not kill a task before starting something like this. If you find that you have rogue tasks in your Task list, then you need to take steps to resolve this - be sure your code isn't leaving remnants behind, for example, and Close/End everything you Open/Start.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
Are you sure you meant to accept my comment with a B grade? Did my comment somehow resolve your problem? If it didn't, then you shouldn't accept it as a solution.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.