<?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: Macros on server in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Macros-on-server/m-p/487575#M1327600</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If possible use an External program task.&lt;/P&gt;&lt;P&gt;Everything in one place and you can use depency also.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 09 Jan 2014 09:42:54 GMT</pubDate>
    <dc:creator>jerrysvensson</dc:creator>
    <dc:date>2014-01-09T09:42:54Z</dc:date>
    <item>
      <title>Macros on server</title>
      <link>https://community.qlik.com/t5/QlikView/Macros-on-server/m-p/487572#M1327597</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Everyone&lt;/P&gt;&lt;P&gt;I'm trying to reload using scheduler QlikView document containing two macros. Macros are used to count files in folder and delete files. Here is example of macro's code:&lt;/P&gt;&lt;P&gt;public function DeleteFile(filePath)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; Set objFSO = CreateObject("Scripting.FileSystemObject")&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; Dim retVal 'as Boolean&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; If objFSO.FileExists(filePath) Then&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Call objFSO.DeleteFile(filePath)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; retVal = true&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; Else&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt; Set objFSO = nothing&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; retVal = false&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&amp;nbsp;&amp;nbsp; End If&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; DeleteFile = retVal&lt;/P&gt;&lt;P&gt;end function&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Locally those macros work fine. But when document is refreshed by scheduler I got general error as a result.&lt;/P&gt;&lt;P&gt;Is there any workaround to launch document on server ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards.&lt;/P&gt;&lt;P&gt;M&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Jan 2026 18:19:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macros-on-server/m-p/487572#M1327597</guid>
      <dc:creator>salezian</dc:creator>
      <dc:date>2026-01-26T18:19:17Z</dc:date>
    </item>
    <item>
      <title>Re: Macros on server</title>
      <link>https://community.qlik.com/t5/QlikView/Macros-on-server/m-p/487573#M1327598</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In scheduler macros never work , you need to run through batch file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Vikas &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Jan 2014 09:15:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macros-on-server/m-p/487573#M1327598</guid>
      <dc:creator>vikasmahajan</dc:creator>
      <dc:date>2014-01-09T09:15:09Z</dc:date>
    </item>
    <item>
      <title>Re: Macros on server</title>
      <link>https://community.qlik.com/t5/QlikView/Macros-on-server/m-p/487574#M1327599</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for answer. Should I schedule file using system scheduler ?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Jan 2014 09:37:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macros-on-server/m-p/487574#M1327599</guid>
      <dc:creator>salezian</dc:creator>
      <dc:date>2014-01-09T09:37:17Z</dc:date>
    </item>
    <item>
      <title>Re: Macros on server</title>
      <link>https://community.qlik.com/t5/QlikView/Macros-on-server/m-p/487575#M1327600</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If possible use an External program task.&lt;/P&gt;&lt;P&gt;Everything in one place and you can use depency also.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Jan 2014 09:42:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macros-on-server/m-p/487575#M1327600</guid>
      <dc:creator>jerrysvensson</dc:creator>
      <dc:date>2014-01-09T09:42:54Z</dc:date>
    </item>
    <item>
      <title>Re: Macros on server</title>
      <link>https://community.qlik.com/t5/QlikView/Macros-on-server/m-p/487576#M1327601</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Unfortunately still doesn't work. Reload is starting but macro doesn't work. It returns null.&lt;/P&gt;&lt;P&gt;Below is macro's code:&lt;/P&gt;&lt;P&gt;public function countFiles(directoryPath)&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim noOfFiles,objFSO,objFolder&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set objFSO = CreateObject("Scripting.FileSystemObject")&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set objFolder=objFSO.GetFolder(directoryPath)&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; noOfFiles=0&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for each file in objFolder.files&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if LCase(objFSO.GetExtensionName(file)="xls") then&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; noOfFiles=noOfFiles+1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end if&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; next&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; countFiles=noOfFiles&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;end function&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Would be grateful for any help.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Jan 2014 10:06:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macros-on-server/m-p/487576#M1327601</guid>
      <dc:creator>salezian</dc:creator>
      <dc:date>2014-01-09T10:06:14Z</dc:date>
    </item>
    <item>
      <title>Re: Macros on server</title>
      <link>https://community.qlik.com/t5/QlikView/Macros-on-server/m-p/487577#M1327602</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What is your inparams?&lt;/P&gt;&lt;P&gt;C:\&amp;lt;dir&amp;gt; or for instance z:\&amp;lt;dir&amp;gt; ?&lt;/P&gt;&lt;P&gt;When you run it in Publisher, it will run in service account that may not have the same drive mapping as your user.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Jan 2014 10:45:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macros-on-server/m-p/487577#M1327602</guid>
      <dc:creator>jerrysvensson</dc:creator>
      <dc:date>2014-01-09T10:45:27Z</dc:date>
    </item>
    <item>
      <title>Re: Macros on server</title>
      <link>https://community.qlik.com/t5/QlikView/Macros-on-server/m-p/487578#M1327603</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I run&amp;nbsp; it using bat file (QV.exe /r path_to_qv_file)&lt;/P&gt;&lt;P&gt;In script I set folder name. Example below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;vFlatFilesPath='C:\ProgramData\QlikTech\Documents\Tesco\Data\FlatFiles'&lt;/P&gt;&lt;P&gt;Let vNoOfFiles=countFiles('$(vFlatFilesPath)');&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Jan 2014 10:49:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macros-on-server/m-p/487578#M1327603</guid>
      <dc:creator>salezian</dc:creator>
      <dc:date>2014-01-09T10:49:31Z</dc:date>
    </item>
    <item>
      <title>Re: Macros on server</title>
      <link>https://community.qlik.com/t5/QlikView/Macros-on-server/m-p/487579#M1327604</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok&lt;/P&gt;&lt;P&gt;Does your service account have a license?&lt;/P&gt;&lt;P&gt;What does the logfile say?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Jan 2014 11:34:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macros-on-server/m-p/487579#M1327604</guid>
      <dc:creator>jerrysvensson</dc:creator>
      <dc:date>2014-01-09T11:34:03Z</dc:date>
    </item>
    <item>
      <title>Re: Macros on server</title>
      <link>https://community.qlik.com/t5/QlikView/Macros-on-server/m-p/487580#M1327605</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes it has.&lt;/P&gt;&lt;P&gt;As I said I try to run it using batch file. Log says that variable &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;vNoOfFiles&lt;/SPAN&gt; is null (but when run locally it works fine).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Jan 2014 12:11:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macros-on-server/m-p/487580#M1327605</guid>
      <dc:creator>salezian</dc:creator>
      <dc:date>2014-01-09T12:11:26Z</dc:date>
    </item>
    <item>
      <title>Re: Macros on server</title>
      <link>https://community.qlik.com/t5/QlikView/Macros-on-server/m-p/487581#M1327606</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you explain what you mean by "but when run locally it works fine". I would think this would have to be ran on the machine that you are wanting the work done on.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Bill&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Jan 2014 13:50:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macros-on-server/m-p/487581#M1327606</guid>
      <dc:creator>Bill_Britt</dc:creator>
      <dc:date>2014-01-10T13:50:20Z</dc:date>
    </item>
    <item>
      <title>Re: Macros on server</title>
      <link>https://community.qlik.com/t5/QlikView/Macros-on-server/m-p/487582#M1327607</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;When I reload it by opening document and hitting ctrl + R.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Jan 2014 15:37:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macros-on-server/m-p/487582#M1327607</guid>
      <dc:creator>salezian</dc:creator>
      <dc:date>2014-01-10T15:37:14Z</dc:date>
    </item>
    <item>
      <title>Re: Macros on server</title>
      <link>https://community.qlik.com/t5/QlikView/Macros-on-server/m-p/487583#M1327608</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have you checked a simple function containing one line 'DeleteFile = true' ?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Jan 2014 19:33:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macros-on-server/m-p/487583#M1327608</guid>
      <dc:creator>whiteline</dc:creator>
      <dc:date>2014-01-10T19:33:02Z</dc:date>
    </item>
    <item>
      <title>Re: Macros on server</title>
      <link>https://community.qlik.com/t5/QlikView/Macros-on-server/m-p/487584#M1327609</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt; CreateObject("Scripting.FileSystemObject")&lt;/SPAN&gt; call requires your module to have System Access. To get System Access from the command line, you have to add the switch /NoSecurity.&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;"&gt;QV.exe /r &lt;STRONG&gt;/NoSecurity&lt;/STRONG&gt; path_to_qv_file&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;-Rob&lt;/P&gt;&lt;P&gt;&lt;A class="jive-link-external-small" href="http://masterssummit.com"&gt;http://masterssummit.com&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="jive-link-external-small" href="http://robwunderlich.com"&gt;http://robwunderlich.com&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Jan 2014 20:03:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macros-on-server/m-p/487584#M1327609</guid>
      <dc:creator>rwunderlich</dc:creator>
      <dc:date>2014-01-10T20:03:41Z</dc:date>
    </item>
    <item>
      <title>Re: Macros on server</title>
      <link>https://community.qlik.com/t5/QlikView/Macros-on-server/m-p/487585#M1327610</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Rob,&lt;/P&gt;&lt;P&gt;Now it works like a charm.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Jan 2014 14:59:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macros-on-server/m-p/487585#M1327610</guid>
      <dc:creator>salezian</dc:creator>
      <dc:date>2014-01-20T14:59:56Z</dc:date>
    </item>
  </channel>
</rss>

