<?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: Close qvw after reload script ended in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Close-qvw-after-reload-script-ended/m-p/1886973#M1217122</link>
    <description>&lt;P&gt;OnOpen triggers are often restricted from various issues, for example timing parameter caused from a parallel respectively multi-threaded execution, for security reasons and usability aspects. This means they may work within your current context but mostly it's better to find other and more stable ways to perform the wanted tasks.&lt;/P&gt;
&lt;P&gt;The comment of the reload/save-statement was just a hint because I missed anything useful within your snippet but I didn't want that they would be immediately active in the case you copy &amp;amp; paste it.&lt;/P&gt;
&lt;P&gt;- Marcus&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 31 Jan 2022 09:41:38 GMT</pubDate>
    <dc:creator>marcus_sommer</dc:creator>
    <dc:date>2022-01-31T09:41:38Z</dc:date>
    <item>
      <title>Close qvw after reload script ended</title>
      <link>https://community.qlik.com/t5/QlikView/Close-qvw-after-reload-script-ended/m-p/1886392#M1217086</link>
      <description>&lt;P&gt;I have a qvw (A) with a macro that opens another qvw(B)&lt;/P&gt;
&lt;P&gt;When B is opened a macro is started that&amp;nbsp; starts a reload script. At the end of the reload script a string is stored to a txt file and a batch file is started.&lt;/P&gt;
&lt;P&gt;Al that works perfect. However I don't succeed in closing B after the reload script of B has finished.&lt;/P&gt;
&lt;P&gt;When I use a macro as below, qvw B is not opened, and when I delete the closing part B does not close.&lt;/P&gt;
&lt;P&gt;I tried several scenarios to close B but I don't get the result I want. It seems that this part 'v.SetContent Var.GetContent. String,true' starts when the macro went through all the code. Putting the closing part in a seperate macro does not help either.&lt;/P&gt;
&lt;P&gt;This is my vbcode:&lt;/P&gt;
&lt;P&gt;sub open_attachment_app&lt;/P&gt;
&lt;P&gt;set Var=ActiveDocument.Variables("number_invoice")&lt;BR /&gt;set App=ActiveDocument.GetApplication&lt;/P&gt;
&lt;P&gt;set UserFile = App.OpenDoc ("E:\\qvdata\retrieve invoice.qvw","","")&lt;BR /&gt;set v = UserFile.Variables("number_invoice")&lt;/P&gt;
&lt;P&gt;v.SetContent Var.GetContent. String,true&lt;/P&gt;
&lt;P&gt;'this is the closing part&lt;BR /&gt;ActiveDocument.GetApplication.Sleep 5000&lt;/P&gt;
&lt;P&gt;set newApp = ActiveDocument.GetApplication&lt;/P&gt;
&lt;P&gt;set newdoc = newApp.OpenDoc ("E:\\qvdata\retrieve_invoice.qvw","","")&lt;/P&gt;
&lt;P&gt;newdoc.GetApplication.WaitForIdle&lt;/P&gt;
&lt;P&gt;newdoc.closedoc&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;end sub&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Changing "newdoc"&amp;nbsp; to "Userfile" does not make any difference&lt;/P&gt;
&lt;P&gt;We are using Qlikview May 2021 SR1&lt;/P&gt;</description>
      <pubDate>Fri, 28 Jan 2022 08:29:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Close-qvw-after-reload-script-ended/m-p/1886392#M1217086</guid>
      <dc:creator>curiousfellow</dc:creator>
      <dc:date>2022-01-28T08:29:15Z</dc:date>
    </item>
    <item>
      <title>Re: Close qvw after reload script ended</title>
      <link>https://community.qlik.com/t5/QlikView/Close-qvw-after-reload-script-ended/m-p/1886408#M1217087</link>
      <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/48508"&gt;@curiousfellow&lt;/a&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am moving this to the App development so you reach the right audience with this question.&lt;/P&gt;</description>
      <pubDate>Fri, 28 Jan 2022 08:48:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Close-qvw-after-reload-script-ended/m-p/1886408#M1217087</guid>
      <dc:creator>Maria_Halley</dc:creator>
      <dc:date>2022-01-28T08:48:46Z</dc:date>
    </item>
    <item>
      <title>Re: Close qvw after reload script ended</title>
      <link>https://community.qlik.com/t5/QlikView/Close-qvw-after-reload-script-ended/m-p/1886575#M1217092</link>
      <description>&lt;P&gt;The following should work:&lt;/P&gt;
&lt;P&gt;sub open_attachment_app&lt;/P&gt;
&lt;P&gt;set Var=ActiveDocument.Variables("number_invoice")&lt;BR /&gt;set App=ActiveDocument.GetApplication&lt;/P&gt;
&lt;P&gt;set UserFile = App.OpenDoc ("E:\qvdata\retrieve invoice.qvw","","")&lt;BR /&gt;set v = UserFile.Variables("number_invoice")&lt;/P&gt;
&lt;P&gt;v.SetContent Var.GetContent.String,true&lt;/P&gt;
&lt;P&gt;'UserFile.reload&lt;BR /&gt;'UserFile.save&lt;BR /&gt;UserFile.closedoc&lt;/P&gt;
&lt;P&gt;end sub&lt;/P&gt;
&lt;P&gt;- Marcus&lt;/P&gt;</description>
      <pubDate>Fri, 28 Jan 2022 14:53:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Close-qvw-after-reload-script-ended/m-p/1886575#M1217092</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2022-01-28T14:53:42Z</dc:date>
    </item>
    <item>
      <title>Re: Close qvw after reload script ended</title>
      <link>https://community.qlik.com/t5/QlikView/Close-qvw-after-reload-script-ended/m-p/1886922#M1217120</link>
      <description>&lt;P&gt;Thank you&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/28038"&gt;@marcus_sommer&lt;/a&gt;&amp;nbsp;. this worked allthough I don't understand why the reload does not work when I open B.&lt;/P&gt;
&lt;P&gt;For the ones who want to use this code too : I had to remove the single quote before 'UserFile.reload and'Use.File.save&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 31 Jan 2022 07:18:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Close-qvw-after-reload-script-ended/m-p/1886922#M1217120</guid>
      <dc:creator>curiousfellow</dc:creator>
      <dc:date>2022-01-31T07:18:27Z</dc:date>
    </item>
    <item>
      <title>Re: Close qvw after reload script ended</title>
      <link>https://community.qlik.com/t5/QlikView/Close-qvw-after-reload-script-ended/m-p/1886973#M1217122</link>
      <description>&lt;P&gt;OnOpen triggers are often restricted from various issues, for example timing parameter caused from a parallel respectively multi-threaded execution, for security reasons and usability aspects. This means they may work within your current context but mostly it's better to find other and more stable ways to perform the wanted tasks.&lt;/P&gt;
&lt;P&gt;The comment of the reload/save-statement was just a hint because I missed anything useful within your snippet but I didn't want that they would be immediately active in the case you copy &amp;amp; paste it.&lt;/P&gt;
&lt;P&gt;- Marcus&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 31 Jan 2022 09:41:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Close-qvw-after-reload-script-ended/m-p/1886973#M1217122</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2022-01-31T09:41:38Z</dc:date>
    </item>
  </channel>
</rss>

