Knowledgebase

Back to Articles List

I receive an error message, "Cannot create automation object".

Problem:

I receive an error message, "Cannot create automation object".

1) I have PDF-XChange 4.0 installed as default printer, and the printer name is "PDF-XChange."
Now we have a Notes application, where I'm using the following coding to set an OLE Automation object, coding doesn’t work with the error message "Cannot create automation object" - the coding is as below.
I know there must be problem with the parameters in 'CreateObject', but I don't know what the right application name / Class name for PDF-XChange 4.0.

2) How can I tell the system to wait until the print job is done?

Code (VBA):

Dim objPrinter As Variant
set objPrinter = CreateObject( "PDFXChange.clsPDFXChange")

Resolution:

1) See code below for creating printer object:

Code (VBA):

Dim objFactory as Variant
Dim objPrinter as Variant

Set objFactory = CreateObject("PXCComLib.CPXCControlEx")
Set objPrinter = objFactory.Printer("", "<name of your printer>", "<YOUR REG CODE>", "<YOUR DEV CODE>")
 
2) To tell the system to wait until the print job is finished - you need to incorporate a wait loop until one of the events;
OnError, or OnDocumentSpooled, fire.
Was this article helpful?
Yes No Somewhat