<?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: VBScript button problem when opening document in server in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/VBScript-button-problem-when-opening-document-in-server/m-p/900459#M313268</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;STRONG&gt;I confirmed that I was wrong&lt;/STRONG&gt; - it is quite possible to do the CreateObject() in a VBScript that runs as a Macro on the server. You will have to set the right security settings both for you application in your QVW but also enable:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Allow unsafe macro execution on server&lt;/P&gt;&lt;P&gt;Allow macro execution on server&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This might not be a very wise thing to do - due to security reasons - but it is possible anyways.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;See below:&lt;/P&gt;&lt;P&gt;&lt;IMG alt="2015-05-11 #3.PNG" class="jive-image image-1" src="/legacyfs/online/86203_2015-05-11 #3.PNG" style="height: 444px; width: 620px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 11 May 2015 19:59:43 GMT</pubDate>
    <dc:creator>petter</dc:creator>
    <dc:date>2015-05-11T19:59:43Z</dc:date>
    <item>
      <title>VBScript button problem when opening document in server</title>
      <link>https://community.qlik.com/t5/QlikView/VBScript-button-problem-when-opening-document-in-server/m-p/900453#M313262</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;&lt;/P&gt;&lt;P&gt;We have a QlikView document where user can click on a button that will trigger VBScript. When opening this document locally everything works. Also when using QlikView installed in server to view this document then functionality also works. Problem is when server has published this document and we try to open it either from AccessPoint or as "open in server" from end user computer. I have attached the error message we get from end user computer( macro parse failed. Functionality was lost). &lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;To be clear then we have changed file paths when moving document from PC to server.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here's the code that is behind VBScript:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800080;"&gt;sub ennustaja&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800080;"&gt;dim horisontti&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800080;"&gt;horisontti = ActiveDocument.Variables("horisontti").GetContent().String&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800080;"&gt;dim objShell&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800080;"&gt;Set objShell = CreateObject("Wscript.Shell")&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800080;"&gt;dim ohjelma&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800080;"&gt;ohjelma = "C:\PROGRA~1\R\R-3.1.3\bin\Rscript.exe"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800080;"&gt;dim scripti&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800080;"&gt;scripti = " C:\PROGRA~1\R\R-3.1.3\bin\r_qlik_w_demo.R"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800080;"&gt;dim cmd&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800080;"&gt;cmd = ohjelma &amp;amp; " " &amp;amp; scripti &amp;amp; " " &amp;amp; horisontti&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800080;"&gt;objShell.Run cmd, 0, True&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800080;"&gt;Set objShell = Nothing&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800080;"&gt;ActiveDocument.ReloadEx 0, 1&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800080;"&gt;end sub &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The idea is that user has selected some numeric variable from 1-10 and then this variable is passed to data mining program R. That will run some analysis and creates new output table that is then used in QlikView by reloading document.&lt;/P&gt;&lt;P&gt;We have enabled module security for this document.&lt;/P&gt;&lt;P&gt;QlikView Server version is &lt;SPAN style="color: #000000; font-family: Tahoma; font-size: 10.6666669845581px;"&gt;11.20.12577.0.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Desktop Solution version is 11.20.127420.0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help is appreciated and let me know if I can provide additional information.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rain&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 May 2015 06:46:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/VBScript-button-problem-when-opening-document-in-server/m-p/900453#M313262</guid>
      <dc:creator />
      <dc:date>2015-05-08T06:46:44Z</dc:date>
    </item>
    <item>
      <title>Re: VBScript button problem when opening document in server</title>
      <link>https://community.qlik.com/t5/QlikView/VBScript-button-problem-when-opening-document-in-server/m-p/900454#M313263</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This probably will never work - as there are clear limitations on what Macros can do on server and this goes beyond what you can do.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So you will have to do something else to achieve this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) A button could start a more "modest" VBscript that will run on the server. Like creating a file on the server.&lt;/P&gt;&lt;P&gt;2) The folder where the file on the server will be created can be set up to be supervised by something called&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Windows FileSystemWatcher:&amp;nbsp; Google this:&lt;/P&gt;&lt;H3 class="post-name" style="font-weight: normal; color: #333333; font-size: 2em; margin: 0 0 15px; font-family: 'Segoe UI', 'Lucida Grande', Verdana, Arial, Helvetica, sans-serif;"&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/H3&gt;&lt;H3 class="post-name" style="font-weight: normal; color: #333333; font-size: 2em; margin: 0 0 15px; font-family: 'Segoe UI', 'Lucida Grande', Verdana, Arial, Helvetica, sans-serif;"&gt;&lt;SPAN style="font-size: 10pt;"&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; How Can I Automatically Run a Script Any Time a File is Added to a Folder?&lt;/SPAN&gt;&lt;/H3&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3) This could trigger a regular VBscript on the server that will do all you wanted to do in the VBScript of your QlikView document&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Mind you ... you will have to replace the ReLoadEx with for instance &lt;STRONG&gt;qv.exe /R xyz.qvw&lt;/STRONG&gt; ...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 May 2015 15:32:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/VBScript-button-problem-when-opening-document-in-server/m-p/900454#M313263</guid>
      <dc:creator>petter</dc:creator>
      <dc:date>2015-05-08T15:32:41Z</dc:date>
    </item>
    <item>
      <title>Re: VBScript button problem when opening document in server</title>
      <link>https://community.qlik.com/t5/QlikView/VBScript-button-problem-when-opening-document-in-server/m-p/900455#M313264</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Petter.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does your explanation of limitations also apply to this kind of test:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Script behind button:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;sub test_cmd&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;dim objShell&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Set objShell = CreateObject("Wscript.Shell")&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;objShell.Run "C:\PROGRA~1\R\Documents\test.bat", 0, True&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Set objShell = Nothing&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;end sub&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;BR /&gt;&lt;/EM&gt;And bat file simply does an output to txt file:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;C:\Windows\System32\ipconfig.exe &amp;gt; C:\PROGRA~1\R\Documents\mynetworksettings.txt&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Because this also works fine normally but not when triggered in QlikView document that has been opened in server.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rain&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 May 2015 05:25:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/VBScript-button-problem-when-opening-document-in-server/m-p/900455#M313264</guid>
      <dc:creator />
      <dc:date>2015-05-11T05:25:39Z</dc:date>
    </item>
    <item>
      <title>Re: VBScript button problem when opening document in server</title>
      <link>https://community.qlik.com/t5/QlikView/VBScript-button-problem-when-opening-document-in-server/m-p/900456#M313265</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you use WebView when opening in server, not plugin, your macro code will run on QlikView server.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When you run your macro in Developer, it is executed on the client.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 May 2015 06:45:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/VBScript-button-problem-when-opening-document-in-server/m-p/900456#M313265</guid>
      <dc:creator>jerrysvensson</dc:creator>
      <dc:date>2015-05-11T06:45:02Z</dc:date>
    </item>
    <item>
      <title>Re: VBScript button problem when opening document in server</title>
      <link>https://community.qlik.com/t5/QlikView/VBScript-button-problem-when-opening-document-in-server/m-p/900457#M313266</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am under the impression that when document is opened in server the option "turn on/off webview" is grayed out.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 May 2015 09:11:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/VBScript-button-problem-when-opening-document-in-server/m-p/900457#M313266</guid>
      <dc:creator />
      <dc:date>2015-05-11T09:11:33Z</dc:date>
    </item>
    <item>
      <title>Re: VBScript button problem when opening document in server</title>
      <link>https://community.qlik.com/t5/QlikView/VBScript-button-problem-when-opening-document-in-server/m-p/900458#M313267</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes I am almost 100% sure that using CreateObject() on the server is prohibited since it would open a wormhole of security problems ... I can make a quick check later this evening to verify it ... maybe you can change the security settings - maybe not.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'll get back to you later.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 May 2015 14:46:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/VBScript-button-problem-when-opening-document-in-server/m-p/900458#M313267</guid>
      <dc:creator>petter</dc:creator>
      <dc:date>2015-05-11T14:46:05Z</dc:date>
    </item>
    <item>
      <title>Re: VBScript button problem when opening document in server</title>
      <link>https://community.qlik.com/t5/QlikView/VBScript-button-problem-when-opening-document-in-server/m-p/900459#M313268</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;STRONG&gt;I confirmed that I was wrong&lt;/STRONG&gt; - it is quite possible to do the CreateObject() in a VBScript that runs as a Macro on the server. You will have to set the right security settings both for you application in your QVW but also enable:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Allow unsafe macro execution on server&lt;/P&gt;&lt;P&gt;Allow macro execution on server&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This might not be a very wise thing to do - due to security reasons - but it is possible anyways.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;See below:&lt;/P&gt;&lt;P&gt;&lt;IMG alt="2015-05-11 #3.PNG" class="jive-image image-1" src="/legacyfs/online/86203_2015-05-11 #3.PNG" style="height: 444px; width: 620px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 May 2015 19:59:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/VBScript-button-problem-when-opening-document-in-server/m-p/900459#M313268</guid>
      <dc:creator>petter</dc:creator>
      <dc:date>2015-05-11T19:59:43Z</dc:date>
    </item>
    <item>
      <title>Re: VBScript button problem when opening document in server</title>
      <link>https://community.qlik.com/t5/QlikView/VBScript-button-problem-when-opening-document-in-server/m-p/900460#M313269</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;But the ReloadEx I am very sure is mentioned to not work on a Server Macro ...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 May 2015 20:01:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/VBScript-button-problem-when-opening-document-in-server/m-p/900460#M313269</guid>
      <dc:creator>petter</dc:creator>
      <dc:date>2015-05-11T20:01:16Z</dc:date>
    </item>
    <item>
      <title>Re: VBScript button problem when opening document in server</title>
      <link>https://community.qlik.com/t5/QlikView/VBScript-button-problem-when-opening-document-in-server/m-p/900461#M313270</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;As I understand there are several ways to use QlikView document that is stored on a server and only one works in our case:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;In QlikView Designer- open in a server doesn't work.&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;Using IE Plugin- doesn't work.&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;Using browser version from Access Point- &lt;STRONG&gt;this works&lt;/STRONG&gt;.&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But Petter is correct- reloadEx doesn't work in any cases. So we probably have to set up reload from QlikView Management Console, create a scheduled task in server or write some custom code? Is that correct or does anybody know of easy way of accomplishing this? Something user friendly and that does reload immediately.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 May 2015 05:56:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/VBScript-button-problem-when-opening-document-in-server/m-p/900461#M313270</guid>
      <dc:creator />
      <dc:date>2015-05-12T05:56:02Z</dc:date>
    </item>
    <item>
      <title>Re: VBScript button problem when opening document in server</title>
      <link>https://community.qlik.com/t5/QlikView/VBScript-button-problem-when-opening-document-in-server/m-p/900462#M313271</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can reload from the commandline/batchfile in at least three ways.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Running QV.exe /R &amp;lt;yourapp&amp;gt;.qvw&lt;/P&gt;&lt;P&gt;- Running Qvb.exe&lt;/P&gt;&lt;P&gt;- qmsedx.exe to trigger QMC reload.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Finally you could also have tiny QVW which only purpose is to poll the filesystem for an inidicator file and if it exists will fail and then you can have a dependency that will execute your reload on this small qvw's failure. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 May 2015 06:44:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/VBScript-button-problem-when-opening-document-in-server/m-p/900462#M313271</guid>
      <dc:creator>petter</dc:creator>
      <dc:date>2015-05-12T06:44:16Z</dc:date>
    </item>
  </channel>
</rss>

