6 Replies Latest reply: Feb 25, 2016 3:22 AM by Paulius Vebra RSS

    Export to PDF Macro is not working as expected

    Nirmal Raj

      Hi Friends,


        I have been working on requirement for last couple of days. I just want to brainstorm on the below scena

      I want to print report as PDF and save it in a particular path. I have used the below macro.

      Sub Auto_Macro



      ActiveDocument.PrintDocReport ("RP01"),"QlikViewPDF", false

      set rep = ActiveDocument.GetReport("RP01")

      reportFile = "C:\Nirmal\Test"&".pdf"



      ActiveDocument.GetApplication.Sleep 12500


      end sub


      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


      This Macro is executing the report but not saving the PDF file in a given path/it is also not creating the PDF file. I am using Windows 7 OS. Kindly assist