Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi !
I'm trying to make an export with PDF, but without having to choose a file name and to press "OK".
I've installed "QlikViewPDF" (which looks like to be a "PDF XChange Writer").
I've found some code in the forum, and tried to adapt it to my report:
set WSHShell = CreateObject("WScript.Shell")
WSHShell.RegWrite "HKCU\Software\QlikViewPDF\OutputFile", pdfPath, "REG_SZ"
WSHShell.RegWrite "HKCU\Software\QlikViewPDF\BypassSaveAs", "1", "REG_SZ"
ActiveDocument.PrintReport "RP01", "QlikViewPDF", false
set WSHShell = nothing
"pdfPath" is a string with the full path and name of my desired PDF.
"RP01" is the ID of my report.
"QlikViewPDF" is the name of my PDF printer.
I've changed the security parameters to allow system access.
When I execute my function, I always have the "Save file as..." window.
I'm not sure that this registry keys are the ones to use...
Did I miss something ?
Finally, I got it !
My mistake was to install the last version of QlickViewPDF (9.00).
In fact, I have to use the previous version : 7.52.
Now it works !
Hello,
Try to replace these lines :
WSHShell.RegWrite "HKCU\Software\QlikViewPDF\OutputFile", pdfPath, "REG_SZ"
WSHShell.RegWrite "HKCU\Software\QlikViewPDF\BypassSaveAs", "1", "REG_SZ"
by these lines :
WSHShell.RegWrite "HKEY_CURRENT_USER\Software\QlikViewPDF\OutputFile", pdfPath
WSHShell.RegWrite "HKEY_CURRENT_USER\Software\QlikViewPDF\BypassSaveAs", 1
I hope that will helps you.
Martin
Does not work either 😞
How do you declare your pdfPath variable ?
Here is my code :
sub SaveFiles
ActiveDocument.GetApplication.WaitForIdle
'Export PDF
set WSHShell = CreateObject("WScript.Shell")
'WSHShell.RegWrite "HKCU\Software\QlikViewPDF\OutputFile", "C:\tmp\file.pdf", "REG_SZ"
'WSHShell.RegWrite "HKCU\Software\QlikViewPDF\BypassSaveAs", "1", "REG_SZ"
WSHShell.RegWrite "HKEY_CURRENT_USER\Software\QlikViewPDF\OutputFile", "C:\tmp\file.pdf"
WSHShell.RegWrite "HKEY_CURRENT_USER\Software\QlikViewPDF\BypassSaveAs", 1
ActiveDocument.PrintReport "RP01", "QlikViewPDF", false
set WSHShell = nothing
end sub
After I run it, here is what I have in my registry :
I notice that the keys are created in the registry by QV (keys don't exists before I run my macro).
There is an entry for "PDF-XChange 3.0" (the real name of "QlickViewPDF") in
HKEY_CURRENT_USER\Software\Tracker Software\PDF-XChange 3.0
So I tried with the following pathes :
WSHShell.RegWrite "HKEY_CURRENT_USER\Software\Tracker Software\PDF-XChange 3.0\OutputFile", "C:\tmp\file.pdf", "REG_SZ"
WSHShell.RegWrite "HKEY_CURRENT_USER\Software\Tracker Software\PDF-XChange 3.0\BypassSaveAs", "1", "REG_SZ"
WSHShell.RegWrite "HKEY_CURRENT_USER\Software\Tracker Software\PDF-XChange 3.0\Drivers\OutputFile", "C:\tmp\file.pdf", "REG_SZ"
WSHShell.RegWrite "HKEY_CURRENT_USER\Software\Tracker Software\PDF-XChange 3.0\Drivers\BypassSaveAs", "1", "REG_SZ"
WSHShell.RegWrite "HKEY_CURRENT_USER\Software\Tracker Software\PDF-XChange 3.0\Drivers\Control\OutputFile", "C:\tmp\file.pdf", "REG_SZ"
WSHShell.RegWrite "HKEY_CURRENT_USER\Software\Tracker Software\PDF-XChange 3.0\Drivers\Control\BypassSaveAs", "1", "REG_SZ"
Nothing worked...
Have you entries for "HKEY_CURRENT_USER\Software\QlikViewPDF\" other than "OutputFile" and "BypassSaveAs" (the one QV created) ?
Finally, I got it !
My mistake was to install the last version of QlickViewPDF (9.00).
In fact, I have to use the previous version : 7.52.
Now it works !
Dear All,
pls help me , I get error in pdfcreator.
Does your report have items ?
Could you post a QV file ?