<?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: Macro Error-End Statement in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Macro-Error-End-Statement/m-p/1541937#M745295</link>
    <description>&lt;P&gt;Hello Marcus,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried enclosing&amp;nbsp;below path but&amp;nbsp; I keep getting error. tried with chr(34) as well but in vain&lt;/P&gt;&lt;PRE&gt;path =""C:\Users\username\Documents\R\R-3.5.1\bin\x64\R.exe CMD BATCH --vanilla --slave C:\Users\username\Desktop\New Folder\New Folder 1\Test.R""&lt;/PRE&gt;&lt;P&gt;Let me know what is the issue in the above code?&lt;/P&gt;</description>
    <pubDate>Sat, 09 Feb 2019 19:39:50 GMT</pubDate>
    <dc:creator>sathish_kumar</dc:creator>
    <dc:date>2019-02-09T19:39:50Z</dc:date>
    <item>
      <title>Macro Error-End Statement</title>
      <link>https://community.qlik.com/t5/QlikView/Macro-Error-End-Statement/m-p/1537857#M745289</link>
      <description>&lt;P&gt;Hello Users&lt;/P&gt;&lt;P&gt;Below macro works absolutely fine when i use it in Excel&amp;nbsp; but when i copy the same macro and paste in Qlikview macro module, i keep getting error "Expected End Statement", "Macro PARSE failed,functionality&amp;nbsp; was lost".&lt;/P&gt;&lt;P&gt;Can you please let me know how to enable this below macro in qlikview? Let me know the changes required for the below macro inorder to be compatible with Qlikview&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Sub RunRscript()
    Dim shell As Object
    Set shell = VBA.CreateObject("WScript.Shell")
    Dim waitTillComplete As Boolean: waitTillComplete = True
    Dim style As Integer: style = 1
    Dim errorCode As Integer
    Dim path As String
    path = "C:\Users\username\Documents\R\R-3.5.1\bin\x64\R.exe CMD BATCH --vanilla --slave C:\Users\username\Desktop\Test.R"
    errorCode = shell.Run(path, style, waitTillComplete)
      
End Sub&lt;/PRE&gt;</description>
      <pubDate>Sat, 16 Nov 2024 21:29:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macro-Error-End-Statement/m-p/1537857#M745289</guid>
      <dc:creator>sathish_kumar</dc:creator>
      <dc:date>2024-11-16T21:29:44Z</dc:date>
    </item>
    <item>
      <title>Re: Macro Error-End Statement</title>
      <link>https://community.qlik.com/t5/QlikView/Macro-Error-End-Statement/m-p/1537870#M745290</link>
      <description>&lt;P&gt;Try:&lt;/P&gt;&lt;P&gt;Sub RunRscript&lt;BR /&gt;Set shell = VBA.CreateObject("WScript.Shell")&lt;BR /&gt;waitTillComplete = True&lt;BR /&gt;style = 1&lt;BR /&gt;path = "C:\Users\username\Documents\R\R-3.5.1\bin\x64\R.exe CMD BATCH --vanilla --slave C:\Users\username\Desktop\Test.R"&lt;BR /&gt;errorCode = shell.Run(path, style, waitTillComplete)&lt;BR /&gt;End Sub&lt;/P&gt;</description>
      <pubDate>Thu, 31 Jan 2019 14:09:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macro-Error-End-Statement/m-p/1537870#M745290</guid>
      <dc:creator>m_woolf</dc:creator>
      <dc:date>2019-01-31T14:09:18Z</dc:date>
    </item>
    <item>
      <title>Re: Macro Error-End Statement</title>
      <link>https://community.qlik.com/t5/QlikView/Macro-Error-End-Statement/m-p/1537898#M745291</link>
      <description>&lt;P&gt;Tried. but not successful..&lt;/P&gt;&lt;P&gt;it is not executing. Just macro module opens up with no actions.&lt;/P&gt;</description>
      <pubDate>Thu, 31 Jan 2019 14:33:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macro-Error-End-Statement/m-p/1537898#M745291</guid>
      <dc:creator>sathish_kumar</dc:creator>
      <dc:date>2019-01-31T14:33:25Z</dc:date>
    </item>
    <item>
      <title>Re: Macro Error-End Statement</title>
      <link>https://community.qlik.com/t5/QlikView/Macro-Error-End-Statement/m-p/1537919#M745292</link>
      <description>&lt;P&gt;I think the reference to VBA is just too much in the example from &lt;A href="https://community.qlik.com/t5/user/viewprofilepage/user-id/14139" target="_self"&gt;Mwoolf&lt;/A&gt;:&lt;/P&gt;&lt;P&gt;Sub RunRscript&lt;BR /&gt;Set shell = &lt;FONT color="#FF0000"&gt;&lt;STRIKE&gt;&lt;STRONG&gt;VBA.&lt;/STRONG&gt;&lt;/STRIKE&gt;&lt;/FONT&gt;CreateObject("WScript.Shell")&lt;BR /&gt;waitTillComplete = True&lt;BR /&gt;style = 1&lt;BR /&gt;path = "C:\Users\username\Documents\R\R-3.5.1\bin\x64\R.exe CMD BATCH --vanilla --slave C:\Users\username\Desktop\Test.R"&lt;BR /&gt;errorCode = shell.Run(path, style, waitTillComplete)&lt;BR /&gt;End Sub&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;</description>
      <pubDate>Thu, 31 Jan 2019 14:48:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macro-Error-End-Statement/m-p/1537919#M745292</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2019-01-31T14:48:41Z</dc:date>
    </item>
    <item>
      <title>Re: Macro Error-End Statement</title>
      <link>https://community.qlik.com/t5/QlikView/Macro-Error-End-Statement/m-p/1541208#M745293</link>
      <description>&lt;P&gt;Hello Marcus&lt;/P&gt;&lt;P&gt;I added new folder in the file path but this is giving error. When i try with NewFolder with no spaces in between ,it works fine but when i use New Folder with spaces in between it is not working.&lt;/P&gt;&lt;P&gt;My .R file is located in Desktop/New Folder/New Folder 1/Test.R&lt;/P&gt;&lt;P&gt;My qvw file is located in Desktop/New Folder/.qvw&lt;/P&gt;&lt;P&gt;Also how to make relative paths for the above files? and how to create relative path for R&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;"..\..\Documents\R\R-3.5.1\bin\X64\R.exe" CMD Batch "New Folder1\Test.R"&lt;/PRE&gt;&lt;PRE&gt;&amp;nbsp;&lt;/PRE&gt;&lt;P&gt;i checked this link&amp;nbsp;&lt;A href="https://stackoverflow.com/questions/15621395/vbscript-relative-path" target="_blank"&gt;https://stackoverflow.com/questions/15621395/vbscript-relative-path&lt;/A&gt;&amp;nbsp;but i was not successful&lt;/P&gt;&lt;P&gt;Can you please help here?&lt;/P&gt;&lt;PRE&gt;Sub RunRscript
Set shell = CreateObject("WScript.Shell")
waitTillComplete = True
style = 1
path = "C:\Users\username\Documents\R\R-3.5.1\bin\x64\R.exe CMD BATCH --vanilla --slave C:\Users\username\Desktop\&lt;STRONG&gt;New Folder\New Folder 1&lt;/STRONG&gt;\Test.R"
errorCode = shell.Run(path, style, waitTillComplete)
End Sub&lt;/PRE&gt;&lt;P&gt;@Anonymous&lt;/P&gt;&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/14139"&gt;@m_woolf&lt;/a&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Feb 2019 21:50:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macro-Error-End-Statement/m-p/1541208#M745293</guid>
      <dc:creator>sathish_kumar</dc:creator>
      <dc:date>2019-02-07T21:50:31Z</dc:date>
    </item>
    <item>
      <title>Re: Macro Error-End Statement</title>
      <link>https://community.qlik.com/t5/QlikView/Macro-Error-End-Statement/m-p/1541352#M745294</link>
      <description>&lt;P&gt;If your full-path contained any space (or other special chars) the path needs to be wrapped with double-quotes. By using variables for the path the quotes needs to be included within the variable. This means something like:&lt;/P&gt;&lt;P&gt;path = "any path"&lt;/P&gt;&lt;P&gt;isn't enough because the variable path contained just: any path and no wrapping quotes around it. This means you need to specify the path-variable with something like:&lt;/P&gt;&lt;P&gt;path = """any path"""&lt;/P&gt;&lt;P&gt;or maybe&lt;/P&gt;&lt;P&gt;path = chr(34) &amp;amp; "any path" &amp;amp; chr(34)&lt;/P&gt;&lt;P&gt;By relative paths I'm not sure if they could applied here - if I look on your link it seems that they suggest to build a fullpath by using the fullpath of the batch and then adjusting it appropriate.&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;</description>
      <pubDate>Fri, 08 Feb 2019 09:03:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macro-Error-End-Statement/m-p/1541352#M745294</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2019-02-08T09:03:49Z</dc:date>
    </item>
    <item>
      <title>Re: Macro Error-End Statement</title>
      <link>https://community.qlik.com/t5/QlikView/Macro-Error-End-Statement/m-p/1541937#M745295</link>
      <description>&lt;P&gt;Hello Marcus,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried enclosing&amp;nbsp;below path but&amp;nbsp; I keep getting error. tried with chr(34) as well but in vain&lt;/P&gt;&lt;PRE&gt;path =""C:\Users\username\Documents\R\R-3.5.1\bin\x64\R.exe CMD BATCH --vanilla --slave C:\Users\username\Desktop\New Folder\New Folder 1\Test.R""&lt;/PRE&gt;&lt;P&gt;Let me know what is the issue in the above code?&lt;/P&gt;</description>
      <pubDate>Sat, 09 Feb 2019 19:39:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macro-Error-End-Statement/m-p/1541937#M745295</guid>
      <dc:creator>sathish_kumar</dc:creator>
      <dc:date>2019-02-09T19:39:50Z</dc:date>
    </item>
    <item>
      <title>Re: Macro Error-End Statement</title>
      <link>https://community.qlik.com/t5/QlikView/Macro-Error-End-Statement/m-p/1542000#M745296</link>
      <description>&lt;P&gt;Just doubling the quotes isn't enough - depending on the used tool and/or the kind of definition/call are 3 or 4 quotes necessary. Most often is the easiest way to a solution to skip the variable in the first step and to write the path directly in the call to check if the path and the other parameter are valid. If it worked you could replace it with a variable and maybe comment the real call and using a msgbox to check if the variable contained exactly the same content as the manual writing.&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;</description>
      <pubDate>Sun, 10 Feb 2019 11:13:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macro-Error-End-Statement/m-p/1542000#M745296</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2019-02-10T11:13:02Z</dc:date>
    </item>
  </channel>
</rss>

