Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
i have downloaded a document regarding creating a PDF Report, In That there is Macro function which have below
Function printReportPDF(pdfOutputFile)
Set WSHShell = CreateObject("WScript.Shell")
WSHShell.RegWrite "HKCU\Software\QlikViewPDF\OutputFile", pdfOutputFile, "REG_SZ"
WSHShell.RegWrite "HKCU\Software\QlikViewPDF\BypassSaveAs", "1", "REG_SZ"
Set WSHShell = nothing
End function
Same i had copied the macro in my QV file as below
Function printReportPDF_NEW(pdfOutputFile)
Set WSHShell = CreateObject("WScript.Shell")
WSHShell.RegWrite "HKCU\Software\QlikViewPDF\OutputFile", pdfOutputFile, "REG_SZ"
WSHShell.RegWrite "HKCU\Software\QlikViewPDF\BypassSaveAs", "1", "REG_SZ"
Set WSHShell = nothing
End function
But the downloaded document working fine , but in my document red marked line giving me error.
"ActiveX component can't create object: 'WScript.Shell' "
Kindly let me know why i am getting error in 1 document and not in other document.
This is usually due to the Module permissions. Open the Module Editor (Ctrl-m) and select "Allow System Access" in the Current Local Security dropdown.
-Rob
Check have you install free pdf printer and sample demo
Hope this helps you
Vikas
Hi,
i had check the same code which u have attached , your code is not giving error while running, same code i copied from your document to my document and its showing me the error on this line
Set WSHShell = CreateObject("WScript.Shell")
Error : "ActiveX component can't create object: 'WScript.Shell' "
This is usually due to the Module permissions. Open the Module Editor (Ctrl-m) and select "Allow System Access" in the Current Local Security dropdown.
-Rob
Thanks Rob,
Its Working Now 🙂
Hi Vikas,
For your example which PDF Creator Application u have used ?
Hi Rob, I have a question
every time I run the macro I get a pop up where it tells me where I should store the file, there is some way to run the default route without having to pop up
rwunderlich please your support
Can you post the macro you are running?
-Rob
This is macro