Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

ActiveX component can't create object: 'PDFCreator.clsPDFCreator'

Hi, Sorry if this has been answered before but I am struggling trying to get PDFCreator working with Qlik.

I found some code to create as a macro but when it gets to

I have installed the latest PDFCreator on the server (v 2.2.1) (but not yet used it) and created a new module as :

Option Explicit

Sub PrintReport()

'ActiveDocument.ClearAll

'Dim FieldName

'FieldName = "Country"

'Dim mySelections

'set mySelections = _

'ActiveDocument.Fields(FieldName).GetPossibleValues

'Dim i

'for i = 0 to mySelections.Count - 1

Dim FieldValue

'FieldValue = mySelections.Item(i).text

'ActiveDocument.Fields(FieldName).Select FieldValue

FieldValue = "201546"

Print_PDF FieldValue, "Op Report", "RP01"

'Next

End Sub

Sub Print_PDF(FieldValue, ReportName, ReportID)

' This is mostly reference code from the

' PDF Creator documentation

' Designed for early bind, set reference to PDFCreator

Dim pdfjob

Dim sPDFName

Dim sPDFPath

'/// Change the output file name here! ///

sPDFName = ReportName & " - " & FieldValue

sPDFPath = "D:\Qlikview"

Set pdfjob = CreateObject("PDFCreator.clsPDFCreator")

With pdfjob

If .cStart("/NoProcessingAtStartup") = False Then

If .cStart("/NoProcessingAtStartup", True) = _

False Then

Exit Sub

End if

.cVisible = True

End If

.cOption("UseAutosave") = 1

.cOption("UseAutosaveDirectory") = 1

.cOption("AutosaveDirectory") = sPDFPath

.cOption("AutosaveFilename") = sPDFName

.cOption("AutosaveFormat") = 0 ' 0 = PDF

.cClearCache

End With

' Print the QlikView Report

ActiveDocument.PrintReport ReportID, "PDFCreator"

' Wait until the print job has entered the print queue

Do Until pdfjob.cCountOfPrintjobs = 1

ActiveDocument.GetApplication.Sleep 20

' in VBScript use WScript.Sleep(20)

Loop

pdfjob.cPrinterStop = False

' Wait until PDF creator is finished

' then release the objects

Do Until pdfjob.cCountOfPrintjobs = 0

ActiveDocument.GetApplication.Sleep 20

Loop

pdfjob.cClose

Set pdfjob = Nothing

End Sub

Note that I have commented out some of the lines in the 'PrintReport' sub to simplify it to my needs.

This is attached to a button in a Qlik document but it didnt seem to do anything.

On going into properties and then editing the module and running 'test' fond where it was stopping.

It calls  'Print_PDF' but then I get

"ActiveX component can't create object: 'PDFCreator.clsPDFCreator'"

when it reaches

Set pdfjob = CreateObject("PDFCreator.clsPDFCreator")


I found someone else having a similar problem which apparently was fixed when he set System access on.

Unfortunately, I had already set this.

I have set Requested Module Security to 'System Access' and Current Local Security to 'Allow System Access'

The Document has been saved and re-opened but the same error persists.

Does anyone have any pointers? Is there another setting somewhere that I have missed?

Running Qlikview 11 SR11 64bit on a Windows Server 2012 R2 datacentre.

Thanks for reading.

Ian

1 Solution

Accepted Solutions
Not applicable
Author

Success.

I discovered .NET framework was not enabled on the server!

I realized this after de-installing PDFCreator and attempting to install V1.6

This then came up with the error whilst trying to install.

Shame the new version didnt tell me that 😞

Now all I have to do is figure out how to email the output out to people automatically 🙂

Hope this helps anyone.

Ian

View solution in original post

3 Replies
Not applicable
Author

Success.

I discovered .NET framework was not enabled on the server!

I realized this after de-installing PDFCreator and attempting to install V1.6

This then came up with the error whilst trying to install.

Shame the new version didnt tell me that 😞

Now all I have to do is figure out how to email the output out to people automatically 🙂

Hope this helps anyone.

Ian

Not applicable
Author

Hi Porter

Am facing similar error as you. Can i know how to enable the .Net framework?

Thanks

Not applicable
Author

Hi,

By Enable, I meant installed.

You can download it from the Microsoft website for free.

Ian