The specifics depend very much on what you're using as PDF writer. In general, your macro should be making changes in registry that:
1. Specify the name of the PDF file and its location
2. Bypass SaveAs
Hope you'll figure out the details. Or try to search this forum, there were similar questions before.
Using this macro you can open the saveas dialog in from in your qv file
Set objDialog = CreateObject("SAFRCFileDlg.FileSave")
objDialog.FileName = "C:\Scripts\Script1.vbs"
objDialog.FileType = "VBScript Script"
intReturn = objDialog.OpenFileSaveDlg
If intReturn Then
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.CreateTextFile(objDialog.FileName)
There are many questions like this here, and there are examples, e.g:
But it may be different for you, as I mentioned above it depends very much on your PDF writer.
PS: If the question is urgent, I recommend to go to QlikTech support, in parallel to this forum.
I don't have a code for PDF-XChange, sorry. See if you can find anything useful here. It started from QlikPDF, but down the line there were answers regarding XChange as well (long 2-page thread):
It seems as WSHShell.RegWrite RegKey & "BypassSaveAs", 1 will only work if the report is a single page report, not a multipage report.......
This is the code I am using to save the report as a pdf:
Set WSHShell = CreateObject("WScript.Shell")
file = "D:\QlikView\QVApps\Development\Contact Centre\cctest.pdf"
RegKey = "HKEY_CURRENT_USER\Software\QlikViewPDF\"
WSHShell.RegWrite RegKey & "BypassSaveAs", 1
WSHShell.RegWrite RegKey & "OutputFile", file
ActiveDocument.PrintDocReport "RP02", "QlikViewPDF"
WSHShell.RegWrite RegKey & "BypassSaveAs", 0
WSHShell.RegWrite RegKey & "OutputFile", ""
Set WSHShell = nothing
The Save as pop up box always appears when the report is a multipage report but doesn't appear if it's a single page report.
Does anyone have a solution to this?