<?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 Macro in qlikview in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Macro-in-qlikview/m-p/117564#M18105</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;I have the below VBA macro which is working fine in excel.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sub RunRscript()&lt;/P&gt;&lt;P&gt;'runs an external R code through Shell&lt;/P&gt;&lt;P&gt;'The location of the RScript is 'C:\R_code'&lt;/P&gt;&lt;P&gt;'The script name is 'hello.R'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Dim shell As Object&lt;/P&gt;&lt;P&gt;Set shell = VBA.CreateObject("WScript.Shell")&lt;/P&gt;&lt;P&gt;Dim waitTillComplete As Boolean: waitTillComplete = True&lt;/P&gt;&lt;P&gt;Dim style As Integer: style = 1&lt;/P&gt;&lt;P&gt;Dim errorCode As Integer&lt;/P&gt;&lt;P&gt;Dim path As String&lt;/P&gt;&lt;P&gt;path = "&lt;SPAN style="color: #c55a11;"&gt;C:\Users\test\Documents\R\R-3.4.3\bin\x64\Rscript &lt;/SPAN&gt;&lt;SPAN style="color: #70ad47;"&gt;C:\Users\test\Documents\text_mst.R&lt;/SPAN&gt;"&lt;/P&gt;&lt;P&gt;errorCode = shell.Run(path, style, waitTillComplete)&lt;/P&gt;&lt;P&gt;End Sub&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now i want this macro to work in qlikview, because the macro is not working in qlikview, getting an error like &lt;STRONG style="text-decoration: underline;"&gt;Expected end of statement&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you please tell me how to do,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Bharat&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 08 Aug 2018 09:44:43 GMT</pubDate>
    <dc:creator>bharatkishore</dc:creator>
    <dc:date>2018-08-08T09:44:43Z</dc:date>
    <item>
      <title>Macro in qlikview</title>
      <link>https://community.qlik.com/t5/QlikView/Macro-in-qlikview/m-p/117564#M18105</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;I have the below VBA macro which is working fine in excel.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sub RunRscript()&lt;/P&gt;&lt;P&gt;'runs an external R code through Shell&lt;/P&gt;&lt;P&gt;'The location of the RScript is 'C:\R_code'&lt;/P&gt;&lt;P&gt;'The script name is 'hello.R'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Dim shell As Object&lt;/P&gt;&lt;P&gt;Set shell = VBA.CreateObject("WScript.Shell")&lt;/P&gt;&lt;P&gt;Dim waitTillComplete As Boolean: waitTillComplete = True&lt;/P&gt;&lt;P&gt;Dim style As Integer: style = 1&lt;/P&gt;&lt;P&gt;Dim errorCode As Integer&lt;/P&gt;&lt;P&gt;Dim path As String&lt;/P&gt;&lt;P&gt;path = "&lt;SPAN style="color: #c55a11;"&gt;C:\Users\test\Documents\R\R-3.4.3\bin\x64\Rscript &lt;/SPAN&gt;&lt;SPAN style="color: #70ad47;"&gt;C:\Users\test\Documents\text_mst.R&lt;/SPAN&gt;"&lt;/P&gt;&lt;P&gt;errorCode = shell.Run(path, style, waitTillComplete)&lt;/P&gt;&lt;P&gt;End Sub&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now i want this macro to work in qlikview, because the macro is not working in qlikview, getting an error like &lt;STRONG style="text-decoration: underline;"&gt;Expected end of statement&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you please tell me how to do,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Bharat&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Aug 2018 09:44:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macro-in-qlikview/m-p/117564#M18105</guid>
      <dc:creator>bharatkishore</dc:creator>
      <dc:date>2018-08-08T09:44:43Z</dc:date>
    </item>
    <item>
      <title>Re: Macro in qlikview</title>
      <link>https://community.qlik.com/t5/QlikView/Macro-in-qlikview/m-p/117565#M18106</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You need to change the syntax because VBS is a bit different to VBA. You could try it in this way:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sub RunRscript()&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Dim shell, waitTillComplete, style, path&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;waitTillComplete = True&lt;/P&gt;&lt;P&gt;style = 1&lt;/P&gt;&lt;P&gt;path = "&lt;SPAN style="color: #c55a11;"&gt;C:\Users\test\Documents\R\R-3.4.3\bin\x64\Rscript &lt;/SPAN&gt;&lt;SPAN style="color: #70ad47;"&gt;C:\Users\test\Documents\text_mst.R&lt;/SPAN&gt;"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Set shell = VBA.CreateObject("WScript.Shell")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;shell.Run(path, style, waitTillComplete)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;End Sub&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Aug 2018 11:28:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macro-in-qlikview/m-p/117565#M18106</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2018-08-08T11:28:33Z</dc:date>
    </item>
    <item>
      <title>Re: Macro in qlikview</title>
      <link>https://community.qlik.com/t5/QlikView/Macro-in-qlikview/m-p/117566#M18107</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;Thank you so much for your reply.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am getting an error like &lt;STRONG style="text-decoration: underline;"&gt;Cannot use parentheses when calling a Sub. &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="text-decoration: underline;"&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Can you please tell me what i need to do.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Bharat&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Aug 2018 04:45:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macro-in-qlikview/m-p/117566#M18107</guid>
      <dc:creator>bharatkishore</dc:creator>
      <dc:date>2018-08-09T04:45:47Z</dc:date>
    </item>
    <item>
      <title>Re: Macro in qlikview</title>
      <link>https://community.qlik.com/t5/QlikView/Macro-in-qlikview/m-p/117567#M18108</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Just use: &lt;STRONG&gt;Sub RunRscript&lt;/STRONG&gt; instead of: Sub &lt;STRONG&gt;RunRscript()&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Aug 2018 05:33:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macro-in-qlikview/m-p/117567#M18108</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2018-08-09T05:33:43Z</dc:date>
    </item>
    <item>
      <title>Re: Macro in qlikview</title>
      <link>https://community.qlik.com/t5/QlikView/Macro-in-qlikview/m-p/117568#M18109</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;Getting same error. Below code i have used.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sub RunRscript&lt;/P&gt;&lt;P&gt;Dim shell, waitTillComplete, style, path&lt;/P&gt;&lt;P&gt;waitTillComplete = True&lt;/P&gt;&lt;P&gt;style = 1&lt;/P&gt;&lt;P&gt;path = "C:\Users\test\Documents\R\R-3.4.3\bin\x64\Rscript C:\Users\test\Documents\text_mst.R"&lt;/P&gt;&lt;P&gt;Set shell = VBA.CreateObject("WScript.Shell")&lt;/P&gt;&lt;P&gt;shell.Run(path, style, waitTillComplete)&lt;/P&gt;&lt;P&gt;End Sub&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please let me know if anything i am missing&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Aug 2018 10:00:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macro-in-qlikview/m-p/117568#M18109</guid>
      <dc:creator>bharatkishore</dc:creator>
      <dc:date>2018-08-09T10:00:38Z</dc:date>
    </item>
    <item>
      <title>Re: Macro in qlikview</title>
      <link>https://community.qlik.com/t5/QlikView/Macro-in-qlikview/m-p/117569#M18110</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok. Try it with removing the brackets on the run-statement to:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;shell.Run path, style, waitTillComplete&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Aug 2018 10:06:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macro-in-qlikview/m-p/117569#M18110</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2018-08-09T10:06:36Z</dc:date>
    </item>
    <item>
      <title>Re: Macro in qlikview</title>
      <link>https://community.qlik.com/t5/QlikView/Macro-in-qlikview/m-p/117570#M18111</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you Marcus.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But when i click the button then instead of running the macro it is going to macro edit module. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you please tell me what i need to do.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Aug 2018 10:12:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macro-in-qlikview/m-p/117570#M18111</guid>
      <dc:creator>bharatkishore</dc:creator>
      <dc:date>2018-08-09T10:12:55Z</dc:date>
    </item>
    <item>
      <title>Re: Macro in qlikview</title>
      <link>https://community.qlik.com/t5/QlikView/Macro-in-qlikview/m-p/117571#M18112</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Your code accessed external resources and needs therefore system-access (about mid within the left panel in the macro-editor). Further I'm not sure if run could handle your second/third parameter - for testing I would comment them. Also placing some msgbox within the code will show where the exections breaks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Aug 2018 11:01:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macro-in-qlikview/m-p/117571#M18112</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2018-08-09T11:01:29Z</dc:date>
    </item>
    <item>
      <title>Re: Macro in qlikview</title>
      <link>https://community.qlik.com/t5/QlikView/Macro-in-qlikview/m-p/117572#M18113</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sure.. thanks .. will try and update you.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Aug 2018 12:17:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macro-in-qlikview/m-p/117572#M18113</guid>
      <dc:creator>bharatkishore</dc:creator>
      <dc:date>2018-08-09T12:17:46Z</dc:date>
    </item>
  </channel>
</rss>

