<?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: Calling VB function in load script in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Calling-VB-function-in-load-script/m-p/538269#M201158</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I believe you need to use the function call inside a load statement - even a dummy load with "autogenerate 1".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As an alternative, however, I'd recommend using a statement EXECUTE that allows running an external command. Something like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EXECUTE cmd.exe /C xcopy "D:\MyFolder\MyFile.txt" "D:\NewFolder" /y;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can probably do it in a similar way with a .BAT file that executes more than a single command at a time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;cheers,&lt;/P&gt;&lt;P&gt;Oleg Troyansky&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.masterssummit.com/"&gt;www.masterssummit.com&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 18 Sep 2013 17:05:48 GMT</pubDate>
    <dc:creator>Oleg_Troyansky</dc:creator>
    <dc:date>2013-09-18T17:05:48Z</dc:date>
    <item>
      <title>Calling VB function in load script</title>
      <link>https://community.qlik.com/t5/QlikView/Calling-VB-function-in-load-script/m-p/538268#M201157</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Qlikview Community,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I could really use someone's help here. How do I go about calling a function written in VB in the QV loadscript?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is the situation:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Each week, we refresh our qlikview dashboard with a new dataset. We have automated this refresh and each week our dashboard looks for a file of the same name (ie. NewData). What we are attempting to do is after the file "NewData" is loaded, we want to move it to a different folder and attach the date to it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have written a VB script that successfully renames and moves a file. That code is below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sub RenameMoveFile()&lt;/P&gt;&lt;P&gt;Dim FSO&lt;/P&gt;&lt;P&gt;Set FSO = CreateObject("Scripting.FileSystemObject")&lt;/P&gt;&lt;P&gt;FSO.MoveFile "C:\Desktop\Test\NewData.txt", "C:\Desktop\Moved\MovedFile.txt"&lt;/P&gt;&lt;P&gt;Set FSO = nothing&lt;/P&gt;&lt;P&gt;End Sub&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I'm having issues with is how to call this function in the load script. &lt;STRONG&gt;I've tried both "Call RenameMoveFile()" and "Let v_RMF = RenameMoveFile()"&lt;/STRONG&gt; which have been popular solutions in this forum. I also have already ensured the my &lt;STRONG&gt;requested module security is set to System Access and my current local security is set to Allow System Access&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any ideas on how to make this work or new solutions would be greatly appreciated!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Alex&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Sep 2013 16:53:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calling-VB-function-in-load-script/m-p/538268#M201157</guid>
      <dc:creator />
      <dc:date>2013-09-18T16:53:48Z</dc:date>
    </item>
    <item>
      <title>Re: Calling VB function in load script</title>
      <link>https://community.qlik.com/t5/QlikView/Calling-VB-function-in-load-script/m-p/538269#M201158</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I believe you need to use the function call inside a load statement - even a dummy load with "autogenerate 1".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As an alternative, however, I'd recommend using a statement EXECUTE that allows running an external command. Something like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EXECUTE cmd.exe /C xcopy "D:\MyFolder\MyFile.txt" "D:\NewFolder" /y;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can probably do it in a similar way with a .BAT file that executes more than a single command at a time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;cheers,&lt;/P&gt;&lt;P&gt;Oleg Troyansky&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.masterssummit.com/"&gt;www.masterssummit.com&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Sep 2013 17:05:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calling-VB-function-in-load-script/m-p/538269#M201158</guid>
      <dc:creator>Oleg_Troyansky</dc:creator>
      <dc:date>2013-09-18T17:05:48Z</dc:date>
    </item>
    <item>
      <title>Re: Calling VB function in load script</title>
      <link>https://community.qlik.com/t5/QlikView/Calling-VB-function-in-load-script/m-p/538270#M201159</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Oleg,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the reply. I have written the VB script within the Edit Module in Qlikview and external commands will not be an option as I do not have control over the server in which our solution is hosted.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could you expand more on your comment "function call inside a load statement - even a dummy load with "autogenerate 1"."?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;Alex&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Sep 2013 17:37:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calling-VB-function-in-load-script/m-p/538270#M201159</guid>
      <dc:creator />
      <dc:date>2013-09-18T17:37:10Z</dc:date>
    </item>
    <item>
      <title>Re: Calling VB function in load script</title>
      <link>https://community.qlik.com/t5/QlikView/Calling-VB-function-in-load-script/m-p/538271#M201160</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;Try like this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/message/78869"&gt;Is there any possibility to call a Macro in the ‘Edit Script’?&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Sep 2013 17:51:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calling-VB-function-in-load-script/m-p/538271#M201160</guid>
      <dc:creator>MayilVahanan</dc:creator>
      <dc:date>2013-09-18T17:51:48Z</dc:date>
    </item>
    <item>
      <title>Re: Calling VB function in load script</title>
      <link>https://community.qlik.com/t5/QlikView/Calling-VB-function-in-load-script/m-p/538272#M201161</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Mayil,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your response. The only issue with that solution is my code is written in VB and cannot be simply inserted into the subroutine as suggested.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sub macroname ()&lt;/P&gt;&lt;P&gt; insert code here....&lt;/P&gt;&lt;P&gt;End sub&lt;/P&gt;&lt;P&gt;Call macroname()&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Unless you know of someway within the edit script that I can temporarily write VB?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Or do you know of a way I can rename/move files within the capabilities of QV code?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Alex&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Sep 2013 17:59:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calling-VB-function-in-load-script/m-p/538272#M201161</guid>
      <dc:creator />
      <dc:date>2013-09-18T17:59:22Z</dc:date>
    </item>
    <item>
      <title>Re: Calling VB function in load script</title>
      <link>https://community.qlik.com/t5/QlikView/Calling-VB-function-in-load-script/m-p/538273#M201162</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;I think , this will answer for your question&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/message/113883"&gt;call sub from script issue&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Sep 2013 18:06:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calling-VB-function-in-load-script/m-p/538273#M201162</guid>
      <dc:creator>MayilVahanan</dc:creator>
      <dc:date>2013-09-18T18:06:33Z</dc:date>
    </item>
    <item>
      <title>Re: Calling VB function in load script</title>
      <link>https://community.qlik.com/t5/QlikView/Calling-VB-function-in-load-script/m-p/538274#M201163</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you all for the responses. Here is my solution:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//In Edit Module:&lt;/P&gt;&lt;P&gt;Function RenameMoveFile()&lt;/P&gt;&lt;P&gt;Dim FSO&lt;/P&gt;&lt;P&gt;Set FSO = CreateObject("Scripting.FileSystemObject")&lt;/P&gt;&lt;P&gt;FSO.MoveFile "C:\Desktop\Test\NewData.txt", "C:\Desktop\Moved\MovedFile.txt"&lt;/P&gt;&lt;P&gt;Set FSO = nothing&lt;/P&gt;&lt;P&gt;End Function&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//In Edit Script:&lt;/P&gt;&lt;P&gt;Load RenameMoveFile();&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Sep 2013 19:19:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calling-VB-function-in-load-script/m-p/538274#M201163</guid>
      <dc:creator />
      <dc:date>2013-09-18T19:19:46Z</dc:date>
    </item>
  </channel>
</rss>

