<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How to Implement Macro and Function in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/How-to-Implement-Macro-and-Function/m-p/1383699#M813684</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Open your QVW and then press CTRL+M. That opens the macro editor and then you can paste the above code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You need to update the macro code by providing a location that exists in your system.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;tempFolder="D:\Upendra\"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and the Sheet ID of the sheet that you want to print.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;ActiveDocument.sheets("SH05").Print&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Make sure you have "Allow System Access" selected.&lt;/P&gt;&lt;P&gt;&lt;IMG alt="t275285_1.png" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/177220_t275285_1.png" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Create a button and then call the macro.&lt;/P&gt;&lt;P&gt;&lt;IMG alt="t275285.png" class="jive-image image-2" src="https://community.qlik.com/legacyfs/online/177221_t275285.png" style="height: auto;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 20 Sep 2017 17:13:19 GMT</pubDate>
    <dc:creator>sudeepkm</dc:creator>
    <dc:date>2017-09-20T17:13:19Z</dc:date>
    <item>
      <title>How to Implement Macro and Function</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-Implement-Macro-and-Function/m-p/1383698#M813681</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I found the following in a previous post at &lt;A href="https://community.qlik.com/thread/18603" target="_blank"&gt;Is it possible to write a function to print a sheet (not report)?&lt;/A&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I do not know how to implement it.&amp;nbsp; I am not sure where I put the sub portion and the function portion.&amp;nbsp; Do I put the sub portion into a button with Action = Run macro?&amp;nbsp; Where do I put the function?&lt;/P&gt;&lt;P&gt;-------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;sub Export&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;tempFolder="D:\Upendra\"&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;reportName="TestDashboard"&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;reportFile = tempFolder &amp;amp; reportName &amp;amp; day(date) &amp;amp; monthname(month(date))&amp;amp;".pdf"&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;'msgbox reportFile&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;printReportPDF reportFile&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;ActiveDocument.GetApplication.Sleep 5000&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;ActiveDocument.sheets("SH05").Print&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;ActiveDocument.GetApplication.Sleep 5000&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;' SendMail&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;'msgbox "saved."&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;end sub&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;'===========================================================================&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Function printReportPDF(pdfOutputFile)&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Set WSHShell = CreateObject("WScript.Shell")&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;WSHShell.RegWrite "HKCU\Software\QlikviewPDF\OutputFile", pdfOutputFile, "REG_SZ"&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;WSHShell.RegWrite "HKCU\Software\QlikviewPDF\BypassSaveAs", "1", "REG_SZ"&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Set WSHShell = nothing&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;End function&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-Implement-Macro-and-Function/m-p/1383698#M813681</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to Implement Macro and Function</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-Implement-Macro-and-Function/m-p/1383699#M813684</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Open your QVW and then press CTRL+M. That opens the macro editor and then you can paste the above code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You need to update the macro code by providing a location that exists in your system.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;tempFolder="D:\Upendra\"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and the Sheet ID of the sheet that you want to print.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;ActiveDocument.sheets("SH05").Print&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Make sure you have "Allow System Access" selected.&lt;/P&gt;&lt;P&gt;&lt;IMG alt="t275285_1.png" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/177220_t275285_1.png" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Create a button and then call the macro.&lt;/P&gt;&lt;P&gt;&lt;IMG alt="t275285.png" class="jive-image image-2" src="https://community.qlik.com/legacyfs/online/177221_t275285.png" style="height: auto;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Sep 2017 17:13:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-Implement-Macro-and-Function/m-p/1383699#M813684</guid>
      <dc:creator>sudeepkm</dc:creator>
      <dc:date>2017-09-20T17:13:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to Implement Macro and Function</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-Implement-Macro-and-Function/m-p/1383700#M813685</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you. This is great.&amp;nbsp; I was wondering where do I call the function?&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Sep 2017 17:16:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-Implement-Macro-and-Function/m-p/1383700#M813685</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-09-20T17:16:37Z</dc:date>
    </item>
  </channel>
</rss>

