<?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: Call a function with parms in script in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Call-a-function-with-parms-in-script/m-p/119493#M601812</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think your problem is not caused from Qlik else from the Excel respectively the tool which has created this file. There were already similar cases here in the community and if I remember correctly these files were mainly created from an online Excel and/or stored on Sharepoint or something similar and they have a slight different file-structure to the default file-structure which a "normal" file would create.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;While Qlik and probably some further tools will fail to open these files (correctly) is Excel more robust and "repairs" the file-structure during another save-statement. If this is true than it's rather unlikely that there will be a fix from the Qlik side and I wouldn't be also very optimistic that there will be soon a change on the Microsoft side.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm glad that it now worked for you whereby I think I would rather use an external batch triggered with an EXECUTE statement than a macro-routine within the script. Here an example how it could be done: &lt;A href="https://community.qlik.com/message/378421"&gt;Re: Load excel files from web&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Beside this you could try to load this file per odbc: &lt;A href="https://community.qlik.com/docs/DOC-7860"&gt;Loading Multiple Excel Sheets Dynamically along with file name and sheet name&lt;/A&gt;. Maybe the "error" is there not relevant.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 28 Sep 2018 15:02:43 GMT</pubDate>
    <dc:creator>marcus_sommer</dc:creator>
    <dc:date>2018-09-28T15:02:43Z</dc:date>
    <item>
      <title>Call a function with parms in script</title>
      <link>https://community.qlik.com/t5/QlikView/Call-a-function-with-parms-in-script/m-p/119485#M601804</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have this function and it works on Desktop with Ctrl+M and Test button.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;function open_and_save &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;STRONG&gt;vFile = "C:\Temp\Informe Conversiones.xlsx"&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;STRONG&gt;set xlApp = CreateObject("Excel.Application")&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;STRONG&gt;xlApp.Visible = false&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;STRONG&gt;xlApp.ScreenUpdating = false&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;STRONG&gt;xlApp.DisplayAlerts = false&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;STRONG&gt;xlApp.Workbooks.Open vFile&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/STRONG&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;STRONG&gt;Set xlDoc = xlApp.Workbooks(1)&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;STRONG&gt;xlDoc.Save&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;STRONG&gt;xlDoc.Close&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;STRONG&gt;xlApp.Quit&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;STRONG&gt;set xlDoc = nothing&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;STRONG&gt;set xlApp = nothing&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;end function&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to add a parm vFile and call it from script but I'm not able to do, any tip or help or suggest ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is what I need to do in the Module Editor&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;function open_and_save (vFile)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;and a call or any other sentece in Script&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Of course any combination of these sentences have worked&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;vFile = 'C:\Temp\Informe Conversiones.xlsx';&lt;/P&gt;&lt;P&gt;vFile = chr(34) &amp;amp; 'C:\Temp\Informe Conversiones.xlsx' &amp;amp; chr(34);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LET vRes = open_and_save($(vFile));&lt;/P&gt;&lt;P&gt;LET vRes = open_and_save(vFile);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Trace vRes=&amp;nbsp; $(vRes);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Please help me&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Thanks in advance&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Joaquín&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Sep 2018 08:33:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Call-a-function-with-parms-in-script/m-p/119485#M601804</guid>
      <dc:creator>Joaquin_Lazaro</dc:creator>
      <dc:date>2018-09-28T08:33:32Z</dc:date>
    </item>
    <item>
      <title>Re: Call a function with parms in script</title>
      <link>https://community.qlik.com/t5/QlikView/Call-a-function-with-parms-in-script/m-p/119486#M601805</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Not each kind of macro will work by calling it from the script, for example everything which needs a ActiveDocument - by an ActiveX statement like createobject() I believe it will but I'm not sure. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Further your code missed a return-value of the function like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;open_and_save = TRUE&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also the parm-creation needs a bit adjusted to:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SET vFile = "C:\Temp\Informe Conversiones.xlsx";&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Beside this was is the reason for opening an Excel during the script-run?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Sep 2018 12:10:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Call-a-function-with-parms-in-script/m-p/119486#M601805</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2018-09-28T12:10:26Z</dc:date>
    </item>
    <item>
      <title>Re: Call a function with parms in script</title>
      <link>https://community.qlik.com/t5/QlikView/Call-a-function-with-parms-in-script/m-p/119487#M601806</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Marcus:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for helping me&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm not using any ActiveDocument object neither property, do I ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have added your instructions and I still have the issue&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to open and save an excel until Qlik solve and publish the bug QV-15143&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I'm doing wrong ?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Sep 2018 13:57:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Call-a-function-with-parms-in-script/m-p/119487#M601806</guid>
      <dc:creator>Joaquin_Lazaro</dc:creator>
      <dc:date>2018-09-28T13:57:49Z</dc:date>
    </item>
    <item>
      <title>Re: Call a function with parms in script</title>
      <link>https://community.qlik.com/t5/QlikView/Call-a-function-with-parms-in-script/m-p/119488#M601807</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If it's a bug, shouldn't you wait until it's fixed?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As a workaround in the meantime, you can use that code in an external VBS file and call it from the script using EXEC.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I wouldn't be surprised if the account running the QlikView services lacks the right to create that file in that folder, while your account does have it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I guess Excel is installed in that computer and the macro does not generate any interactive dialog.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Sep 2018 14:15:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Call-a-function-with-parms-in-script/m-p/119488#M601807</guid>
      <dc:creator>Miguel_Angel_Baeyens</dc:creator>
      <dc:date>2018-09-28T14:15:19Z</dc:date>
    </item>
    <item>
      <title>Re: Call a function with parms in script</title>
      <link>https://community.qlik.com/t5/QlikView/Call-a-function-with-parms-in-script/m-p/119489#M601808</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What do you mean with: "I need to open and save an excel until Qlik solve and publish the bug QV-15143" ? What is the aim of opening, saving and closing an Excel while a script runs? You could not write or export anything from the script into the Excel per macro - is this the aim?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Sep 2018 14:17:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Call-a-function-with-parms-in-script/m-p/119489#M601808</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2018-09-28T14:17:25Z</dc:date>
    </item>
    <item>
      <title>Re: Call a function with parms in script</title>
      <link>https://community.qlik.com/t5/QlikView/Call-a-function-with-parms-in-script/m-p/119490#M601809</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Marcus:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I read the excel with a load, the script load blanks or nulls; if I open and save manually the excel and then I run the script it works fine. This is the reason&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The macro code runs well now, using &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;SET vFile = "C:\Temp\Informe Conversiones.xlsx";&lt;/SPAN&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;as you said before.&lt;/SPAN&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;&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; font-size: 13px;"&gt;I had some MSGBOX to debug the code; I removed them and every works fine.&lt;/SPAN&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;&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; font-size: 13px;"&gt;Thanks for your help. again&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Sep 2018 14:23:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Call-a-function-with-parms-in-script/m-p/119490#M601809</guid>
      <dc:creator>Joaquin_Lazaro</dc:creator>
      <dc:date>2018-09-28T14:23:18Z</dc:date>
    </item>
    <item>
      <title>Re: Call a function with parms in script</title>
      <link>https://community.qlik.com/t5/QlikView/Call-a-function-with-parms-in-script/m-p/119491#M601810</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Miguel:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;By the way, this is a workaround until the bug is fixed. There are a lot of different workarounds&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the bug were fixed tomorrow, of course I wait ... but there are not a date &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As I said in my previous post, finally it works fine&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your help, too&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Sep 2018 14:28:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Call-a-function-with-parms-in-script/m-p/119491#M601810</guid>
      <dc:creator>Joaquin_Lazaro</dc:creator>
      <dc:date>2018-09-28T14:28:18Z</dc:date>
    </item>
    <item>
      <title>Re: Call a function with parms in script</title>
      <link>https://community.qlik.com/t5/QlikView/Call-a-function-with-parms-in-script/m-p/119492#M601811</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;One of the issues with macros in the script is that the account running the QlikView Services often (and should) lack of interactive rights. These accounts run in Session 0 which means that, whatever prompt, dialog or window which may pop up as a result of the execution of the macro will stop the script, as the account never "sees" those items popping up. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So if there is a window asking for "Save as" or a warning with an "OK" button, these will never be "clicked". It works for you because you can interact with those dialogs and click.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The existence of those MSGBOXes seems to explain all the above.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Sep 2018 14:44:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Call-a-function-with-parms-in-script/m-p/119492#M601811</guid>
      <dc:creator>Miguel_Angel_Baeyens</dc:creator>
      <dc:date>2018-09-28T14:44:32Z</dc:date>
    </item>
    <item>
      <title>Re: Call a function with parms in script</title>
      <link>https://community.qlik.com/t5/QlikView/Call-a-function-with-parms-in-script/m-p/119493#M601812</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think your problem is not caused from Qlik else from the Excel respectively the tool which has created this file. There were already similar cases here in the community and if I remember correctly these files were mainly created from an online Excel and/or stored on Sharepoint or something similar and they have a slight different file-structure to the default file-structure which a "normal" file would create.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;While Qlik and probably some further tools will fail to open these files (correctly) is Excel more robust and "repairs" the file-structure during another save-statement. If this is true than it's rather unlikely that there will be a fix from the Qlik side and I wouldn't be also very optimistic that there will be soon a change on the Microsoft side.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm glad that it now worked for you whereby I think I would rather use an external batch triggered with an EXECUTE statement than a macro-routine within the script. Here an example how it could be done: &lt;A href="https://community.qlik.com/message/378421"&gt;Re: Load excel files from web&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Beside this you could try to load this file per odbc: &lt;A href="https://community.qlik.com/docs/DOC-7860"&gt;Loading Multiple Excel Sheets Dynamically along with file name and sheet name&lt;/A&gt;. Maybe the "error" is there not relevant.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Sep 2018 15:02:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Call-a-function-with-parms-in-script/m-p/119493#M601812</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2018-09-28T15:02:43Z</dc:date>
    </item>
  </channel>
</rss>

