<?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: Function execute in load script: Error message in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Function-execute-in-load-script-Error-message/m-p/1740208#M590627</link>
    <description>&lt;P&gt;It's not quite clear for me where do you want to do what but I think it's not possible in this way. Your error-message comes probably through the parser which detects invalid code/syntax, like the missing function return-value or that you put the function within the script and not within the macro-editor.&lt;/P&gt;&lt;P&gt;Beside this you couldn't call an ActiveX statement like "CreateObject" within the script-run because the for this required features/libraries aren't available in the script else only if the datamodel is built and an UI for the application exists.&lt;/P&gt;&lt;P&gt;What you could instead do is to call a batch-file per EXECUTE which does all the wanted work. Here an example what is meant: &lt;A href="https://community.qlik.com/t5/QlikView-App-Development/Run-Excel-from-QMC/m-p/1007480" target="_self"&gt;Run-Excel-from-QMC&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;</description>
    <pubDate>Tue, 01 Sep 2020 12:41:21 GMT</pubDate>
    <dc:creator>marcus_sommer</dc:creator>
    <dc:date>2020-09-01T12:41:21Z</dc:date>
    <item>
      <title>Function execute in load script: Error message</title>
      <link>https://community.qlik.com/t5/QlikView/Function-execute-in-load-script-Error-message/m-p/1739754#M590626</link>
      <description>&lt;P&gt;I am trying to run a VBA macro in my script like this: (See below)&lt;/P&gt;&lt;P&gt;Script:&lt;/P&gt;&lt;P&gt;Trace #&amp;lt;&amp;lt; Text &amp;gt;&amp;gt;#;&lt;BR /&gt;EXECUTE CMD.EXE /c del "File.xlsx";&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; //Remove a temp file in office&lt;BR /&gt;Let vExecute = 'ExecuteExl_an()';&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; //Call excel&lt;/P&gt;&lt;P&gt;But I receive the following error even BEFORE the "Trace" script command is executed:&lt;/P&gt;&lt;P&gt;&amp;nbsp; Script line error:&lt;/P&gt;&lt;P&gt;SUB&lt;/P&gt;&lt;P&gt;And just after the EXECUTE line the following error:&lt;/P&gt;&lt;P&gt;Script line error:&lt;/P&gt;&lt;P&gt;End Sub&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am not sure why a SUB error will occur at this point.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The macro:&lt;/P&gt;&lt;P&gt;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%&lt;/P&gt;&lt;P&gt;Let vExecute = 'ExecuteExl_an()';&lt;/P&gt;&lt;P&gt;The VBA code is executed via a Function:&lt;/P&gt;&lt;P&gt;Function ExecuteExl_an()&lt;BR /&gt;Set objExcel = CreateObject("Excel.Application")&lt;/P&gt;&lt;P&gt;objExcel.Visible = True&lt;/P&gt;&lt;P&gt;Set objWorkbook = objExcel.Workbooks.Open(Path)&lt;/P&gt;&lt;P&gt;objWorkbook.Application.Run "Macro"&lt;/P&gt;&lt;P&gt;Set xlBook = Nothing&lt;BR /&gt;Set xlApp = Nothing&lt;BR /&gt;End Function&lt;/P&gt;&lt;P&gt;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%&lt;/P&gt;</description>
      <pubDate>Mon, 31 Aug 2020 08:04:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Function-execute-in-load-script-Error-message/m-p/1739754#M590626</guid>
      <dc:creator>Marius_</dc:creator>
      <dc:date>2020-08-31T08:04:58Z</dc:date>
    </item>
    <item>
      <title>Re: Function execute in load script: Error message</title>
      <link>https://community.qlik.com/t5/QlikView/Function-execute-in-load-script-Error-message/m-p/1740208#M590627</link>
      <description>&lt;P&gt;It's not quite clear for me where do you want to do what but I think it's not possible in this way. Your error-message comes probably through the parser which detects invalid code/syntax, like the missing function return-value or that you put the function within the script and not within the macro-editor.&lt;/P&gt;&lt;P&gt;Beside this you couldn't call an ActiveX statement like "CreateObject" within the script-run because the for this required features/libraries aren't available in the script else only if the datamodel is built and an UI for the application exists.&lt;/P&gt;&lt;P&gt;What you could instead do is to call a batch-file per EXECUTE which does all the wanted work. Here an example what is meant: &lt;A href="https://community.qlik.com/t5/QlikView-App-Development/Run-Excel-from-QMC/m-p/1007480" target="_self"&gt;Run-Excel-from-QMC&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;</description>
      <pubDate>Tue, 01 Sep 2020 12:41:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Function-execute-in-load-script-Error-message/m-p/1740208#M590627</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2020-09-01T12:41:21Z</dc:date>
    </item>
    <item>
      <title>Re: Function execute in load script: Error message</title>
      <link>https://community.qlik.com/t5/QlikView/Function-execute-in-load-script-Error-message/m-p/1744061#M590628</link>
      <description>&lt;P&gt;The following Help link should provide further information along the lines Marcus was discussing along with an example.&amp;nbsp; If you are just trying to detele a Temp file though, why not simply make a call to system Delete function via Cmd.exe /c Delete filename...&lt;/P&gt;&lt;P&gt;&lt;A href="https://help.qlik.com/en-US/qlikview/April2020/Subsystems/Client/Content/QV_QlikView/VBFunctionCalls.htm" target="_blank"&gt;https://help.qlik.com/en-US/qlikview/April2020/Subsystems/Client/Content/QV_QlikView/VBFunctionCalls.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;BR /&gt;Brett&lt;/P&gt;</description>
      <pubDate>Tue, 15 Sep 2020 17:12:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Function-execute-in-load-script-Error-message/m-p/1744061#M590628</guid>
      <dc:creator>Brett_Bleess</dc:creator>
      <dc:date>2020-09-15T17:12:49Z</dc:date>
    </item>
  </channel>
</rss>

