<?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 Macro is not triggered on server reload? in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Macro-is-not-triggered-on-server-reload/m-p/1992629#M82137</link>
    <description>&lt;P&gt;I created the following VB macro:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;SUB ExportTest

if(Weekday(date)) = "6" Then
SET ExportTable = ActiveDocument.GetSheetObject("CH243")
ExportTable.Export "D:\Data\Test\Test2\Test_"&amp;amp;date&amp;amp;".csv", ";" 

End If

END SUB
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;and created a document trigger "OnPostReload" to start the macro.&lt;/P&gt;
&lt;P&gt;If I do a reload the app in the local client it runs fine, on the server nothing happens.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What do&amp;nbsp; I miss?&lt;/P&gt;</description>
    <pubDate>Fri, 14 Oct 2022 08:28:21 GMT</pubDate>
    <dc:creator>qlikconsultant</dc:creator>
    <dc:date>2022-10-14T08:28:21Z</dc:date>
    <item>
      <title>Macro is not triggered on server reload?</title>
      <link>https://community.qlik.com/t5/App-Development/Macro-is-not-triggered-on-server-reload/m-p/1992629#M82137</link>
      <description>&lt;P&gt;I created the following VB macro:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;SUB ExportTest

if(Weekday(date)) = "6" Then
SET ExportTable = ActiveDocument.GetSheetObject("CH243")
ExportTable.Export "D:\Data\Test\Test2\Test_"&amp;amp;date&amp;amp;".csv", ";" 

End If

END SUB
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;and created a document trigger "OnPostReload" to start the macro.&lt;/P&gt;
&lt;P&gt;If I do a reload the app in the local client it runs fine, on the server nothing happens.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What do&amp;nbsp; I miss?&lt;/P&gt;</description>
      <pubDate>Fri, 14 Oct 2022 08:28:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Macro-is-not-triggered-on-server-reload/m-p/1992629#M82137</guid>
      <dc:creator>qlikconsultant</dc:creator>
      <dc:date>2022-10-14T08:28:21Z</dc:date>
    </item>
    <item>
      <title>Re: Macro is not triggered on server reload?</title>
      <link>https://community.qlik.com/t5/App-Development/Macro-is-not-triggered-on-server-reload/m-p/1992636#M82140</link>
      <description>&lt;P&gt;It's not possible - at least not directly. You will always need to execute it with the desktop client but such tasks might be triggered from the qmc. To implement such things isn't trivial and depending on your environment and the targets it could be quite difficult.&lt;/P&gt;
&lt;P&gt;There exists already a lot of postings to the topic which you could find within the community (looking there directly or per google). Here some links as starting point for further investigations:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.qlik.com/t5/QlikView-App-Dev/How-to-Run-macros-in-QMC/td-p/985383" target="_blank"&gt;How to Run macros in QMC - Qlik Community - 985383&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.qlik.com/t5/QlikView-App-Dev/Macro-not-running-in-task/td-p/751" target="_blank"&gt;Solved: Macro not running in task - Qlik Community - 751&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.qlik.com/t5/QlikView-App-Dev/Run-Excel-macro-via-QMC/td-p/1133941" target="_blank"&gt;Run Excel macro via QMC - Qlik Community - 1133941&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;- Marcus&lt;/P&gt;</description>
      <pubDate>Fri, 14 Oct 2022 08:47:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Macro-is-not-triggered-on-server-reload/m-p/1992636#M82140</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2022-10-14T08:47:29Z</dc:date>
    </item>
    <item>
      <title>Re: Macro is not triggered on server reload?</title>
      <link>https://community.qlik.com/t5/App-Development/Macro-is-not-triggered-on-server-reload/m-p/1993428#M82214</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/13090"&gt;@qlikconsultant&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This limitation is documented in our documentation"&lt;/P&gt;
&lt;P&gt;&lt;A href="https://help.qlik.com/en-US/qlikview/May2022/Subsystems/Client/Content/QV_QlikView/UsingMacrosonQVS.htm" target="_blank"&gt;https://help.qlik.com/en-US/qlikview/May2022/Subsystems/Client/Content/QV_QlikView/UsingMacrosonQVS.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;"The following triggers are not to be used in the QlikView Server environment, since they lack meaning or may cause unexpected results:&lt;/EM&gt;&lt;/P&gt;
&lt;P class="Code"&gt;&lt;EM&gt;OnPostReduceData&lt;/EM&gt;&lt;/P&gt;
&lt;P class="Code"&gt;&lt;EM&gt;OnPostReload"&lt;/EM&gt;&lt;/P&gt;
&lt;P class="Code"&gt;We recommend to verify limitations for macros running on Server prior developing a solution to make sure that the functionality is supported.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 17 Oct 2022 15:36:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Macro-is-not-triggered-on-server-reload/m-p/1993428#M82214</guid>
      <dc:creator>NadiaB</dc:creator>
      <dc:date>2022-10-17T15:36:39Z</dc:date>
    </item>
    <item>
      <title>Re: Macro is not triggered on server reload?</title>
      <link>https://community.qlik.com/t5/App-Development/Macro-is-not-triggered-on-server-reload/m-p/2012596#M83701</link>
      <description>&lt;P&gt;@&lt;A href="https://community.qlik.com/t5/user/viewprofilepage/user-id/28038" target="_blank"&gt;&lt;SPAN&gt;Marcus_sommer&lt;/SPAN&gt;&lt;/A&gt; &lt;SPAN&gt;Thanks for the links, which gave me some ideas.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/22488"&gt;@NadiaB&lt;/a&gt; Well hidden in the small print! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Dec 2022 09:50:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Macro-is-not-triggered-on-server-reload/m-p/2012596#M83701</guid>
      <dc:creator>qlikconsultant</dc:creator>
      <dc:date>2022-12-05T09:50:43Z</dc:date>
    </item>
    <item>
      <title>Re: Macro is not triggered on server reload?</title>
      <link>https://community.qlik.com/t5/App-Development/Macro-is-not-triggered-on-server-reload/m-p/2012600#M83703</link>
      <description>&lt;P&gt;For all those who have the problem, here is my workaround:&lt;/P&gt;
&lt;P&gt;1) In QlikView go to Tools =&amp;gt; Edit Module&lt;/P&gt;
&lt;P&gt;Insert you export script here an example:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;SUB ExporttoCsv
SET ExportTable = ActiveDocument.GetSheetObject("Objectcode like CH04")
ExportTable.Export "Path&amp;amp;Filename.csv", ";" 
END SUB
&lt;/LI-CODE&gt;
&lt;P&gt;In Edit Module:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Set Scripting Engine to “VBSCript”.&lt;/LI&gt;
&lt;LI&gt;Set Requested Module Security “System Access”&lt;/LI&gt;
&lt;LI&gt;Set Current Local Security to “Allow System Access”&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;Run the test and be sure that is correct saved.&lt;/P&gt;
&lt;P&gt;2) Create a trigger in “OnPostReload”. The Trigger is “Run Macro” and you use the macro name, in this example ”ExporttoCsv”.&lt;/P&gt;
&lt;P&gt;If you reload the file now it should work but not on the server.&lt;/P&gt;
&lt;P&gt;3) For automated reload create a cmd file with the following code:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;"C:\Program Files\QlikView\Qv.exe" /r c:\yourpath\your file.qvw&lt;/LI-CODE&gt;
&lt;P&gt;Then create a job in the windows “Task Scheduler” to run the reload on a schedule.&lt;/P&gt;</description>
      <pubDate>Mon, 05 Dec 2022 09:57:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Macro-is-not-triggered-on-server-reload/m-p/2012600#M83703</guid>
      <dc:creator>qlikconsultant</dc:creator>
      <dc:date>2022-12-05T09:57:15Z</dc:date>
    </item>
  </channel>
</rss>

