<?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 Delete ( Close ) all linked object by macro vb in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Delete-Close-all-linked-object-by-macro-vb/m-p/513269#M191780</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;In this example we have a macro subroutine to delete all gauges.&lt;/P&gt;&lt;P&gt;The subroutine goes well, but sometime doesn't go.&lt;/P&gt;&lt;P&gt;I suppose it will be a time-out problem, but the question is:&lt;/P&gt;&lt;P&gt;there is another way to delete (close) all gauges with one command like in interactive mode?&lt;/P&gt;&lt;P&gt;When you delete an object and you have some other linked objects, the system ask you if you want to delete all objects or only selected.&lt;/P&gt;&lt;P&gt;There is a parameter to delete (close)&amp;nbsp; all by macro?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;objIndicators(i).close all &lt;/P&gt;&lt;P&gt;objIndicators(i).close true&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 04 Oct 2013 12:38:09 GMT</pubDate>
    <dc:creator />
    <dc:date>2013-10-04T12:38:09Z</dc:date>
    <item>
      <title>Delete ( Close ) all linked object by macro vb</title>
      <link>https://community.qlik.com/t5/QlikView/Delete-Close-all-linked-object-by-macro-vb/m-p/513269#M191780</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;In this example we have a macro subroutine to delete all gauges.&lt;/P&gt;&lt;P&gt;The subroutine goes well, but sometime doesn't go.&lt;/P&gt;&lt;P&gt;I suppose it will be a time-out problem, but the question is:&lt;/P&gt;&lt;P&gt;there is another way to delete (close) all gauges with one command like in interactive mode?&lt;/P&gt;&lt;P&gt;When you delete an object and you have some other linked objects, the system ask you if you want to delete all objects or only selected.&lt;/P&gt;&lt;P&gt;There is a parameter to delete (close)&amp;nbsp; all by macro?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;objIndicators(i).close all &lt;/P&gt;&lt;P&gt;objIndicators(i).close true&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Oct 2013 12:38:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Delete-Close-all-linked-object-by-macro-vb/m-p/513269#M191780</guid>
      <dc:creator />
      <dc:date>2013-10-04T12:38:09Z</dc:date>
    </item>
    <item>
      <title>Re: Delete ( Close ) all linked object by macro vb</title>
      <link>https://community.qlik.com/t5/QlikView/Delete-Close-all-linked-object-by-macro-vb/m-p/513270#M191781</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Corrado,&lt;/P&gt;&lt;P&gt;why do you delete gauges in two different way?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Han&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Oct 2013 12:58:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Delete-Close-all-linked-object-by-macro-vb/m-p/513270#M191781</guid>
      <dc:creator />
      <dc:date>2013-10-07T12:58:40Z</dc:date>
    </item>
    <item>
      <title>Re: Delete ( Close ) all linked object by macro vb</title>
      <link>https://community.qlik.com/t5/QlikView/Delete-Close-all-linked-object-by-macro-vb/m-p/513271#M191782</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Han,&lt;/P&gt;&lt;P&gt;if you look at the API on Close member you find for SheetObject and Container this example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;rem ** remove all sheet objects on sheet Main **&lt;/P&gt;&lt;P&gt;set s=ActiveDocument.Sheets("Main")&lt;/P&gt;&lt;P&gt;orignumber=s.NoOfSheetObjects&lt;/P&gt;&lt;P&gt;for i=0 to orignumber-1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; s.SheetObjects(0).Close&lt;/P&gt;&lt;P&gt;next&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But if you try to find and close the object inside the container this example doesn't go.&lt;/P&gt;&lt;P&gt;Now I have some object (in my case some gauges) in a container and I need to close them. &lt;/P&gt;&lt;P&gt;I have found this way:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;function IndicatorContainerDestroy (sContainer)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;set objContainer = ActiveDocument.GetSheetObject(sContainer)&lt;/P&gt;&lt;P&gt;pContainer = objContainer.GetProperties&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for i =&amp;nbsp; 0 to pContainer.ContainedObjects.Count -1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; sGaugeName = pContainer.ContainedObjects.Item(i).Def.ObjectId&lt;/P&gt;&lt;P&gt;&amp;nbsp; set objGauge = ActiveDocument.GetSheetObject(sGaugeName)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; objGauge.close&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;next&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;end function&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Corrado.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Oct 2013 07:50:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Delete-Close-all-linked-object-by-macro-vb/m-p/513271#M191782</guid>
      <dc:creator />
      <dc:date>2013-10-08T07:50:24Z</dc:date>
    </item>
    <item>
      <title>Re: Delete ( Close ) all linked object by macro vb</title>
      <link>https://community.qlik.com/t5/QlikView/Delete-Close-all-linked-object-by-macro-vb/m-p/513272#M191783</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Corrado,&lt;/P&gt;&lt;P&gt;If You have just two linked gauges why don't you use this loop?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;function IndicatorSheetDestroy (sSheetName)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;set objSheet = ActiveDocument.Sheets(sSheetName) &lt;/P&gt;&lt;P&gt;objIndicators = objSheet.GetSheetObjects&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for j = 1 to 2&lt;/P&gt;&lt;P&gt;&amp;nbsp; for i = lBound(objIndicators) To uBound(objIndicators)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; id = objIndicators(i).GetObjectId&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ty = objIndicators(i).GetObjectType&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; if&amp;nbsp; ty = 22 then&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; set objGauge = ActiveDocument.GetSheetObject(id)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; objGauge.close&lt;/P&gt;&lt;P&gt;&amp;nbsp; 'objIndicators(i).close&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; end if&lt;/P&gt;&lt;P&gt;&amp;nbsp; next&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;next&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;end function&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reguards&lt;/P&gt;&lt;P&gt;Han&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Oct 2013 16:14:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Delete-Close-all-linked-object-by-macro-vb/m-p/513272#M191783</guid>
      <dc:creator />
      <dc:date>2013-10-08T16:14:16Z</dc:date>
    </item>
    <item>
      <title>Re: Delete ( Close ) all linked object by macro vb</title>
      <link>https://community.qlik.com/t5/QlikView/Delete-Close-all-linked-object-by-macro-vb/m-p/513273#M191784</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Han,&lt;/P&gt;&lt;P&gt;I have tested your suggestion and I have to note that:&lt;/P&gt;&lt;P&gt;the main loop looks always the gauges in the same sheet, but &lt;/P&gt;&lt;P&gt;why the first close command delete the gauge in the container?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Why if I put the "j" loop as internal it delete just one gauge in container an then the loop stops itself?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The "j" loop as internal:&lt;/P&gt;&lt;P&gt;function IndicatorSheetDestroyIntenalLoop (sSheetName)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;set objSheet = ActiveDocument.Sheets(sSheetName) &lt;/P&gt;&lt;P&gt;objIndicators = objSheet.GetSheetObjects&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; for i = lBound(objIndicators) To uBound(objIndicators)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; id = objIndicators(i).GetObjectId&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ty = objIndicators(i).GetObjectType&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; if&amp;nbsp; ty = 22 then&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp; for j = 1 to 2&lt;/P&gt;&lt;P&gt;&amp;nbsp; set objGauge = ActiveDocument.GetSheetObject(id)&lt;/P&gt;&lt;P&gt;&amp;nbsp; 'objIndicators(i).close&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; objGauge.close&lt;/P&gt;&lt;P&gt;&amp;nbsp; next&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; end if&lt;/P&gt;&lt;P&gt;&amp;nbsp; next&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;end function&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;&lt;P&gt;Corrado.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Oct 2013 17:29:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Delete-Close-all-linked-object-by-macro-vb/m-p/513273#M191784</guid>
      <dc:creator />
      <dc:date>2013-10-09T17:29:41Z</dc:date>
    </item>
    <item>
      <title>Re: Delete ( Close ) all linked object by macro vb</title>
      <link>https://community.qlik.com/t5/QlikView/Delete-Close-all-linked-object-by-macro-vb/m-p/513274#M191785</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Corrado,&lt;/P&gt;&lt;P&gt;nice question!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've tested the function too, it seems there is a stack lifo and close command delete the last in!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Another question:&lt;/P&gt;&lt;P&gt;If You want&amp;nbsp; to choose which one to delete?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And then:&lt;/P&gt;&lt;P&gt;How many object there are in any stack?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope that some other can answer at these questions or add some information about how to manage linked objects by macro vb.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Han.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Oct 2013 13:21:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Delete-Close-all-linked-object-by-macro-vb/m-p/513274#M191785</guid>
      <dc:creator />
      <dc:date>2013-10-10T13:21:49Z</dc:date>
    </item>
    <item>
      <title>Re: Delete ( Close ) all linked object by macro vb</title>
      <link>https://community.qlik.com/t5/QlikView/Delete-Close-all-linked-object-by-macro-vb/m-p/513275#M191786</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Han,&lt;/P&gt;&lt;P&gt;look at the image below:&lt;/P&gt;&lt;P&gt;In caption of chart property you can see the number of linked objects!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;May be it's an SheetObject property.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Corrado.&lt;IMG alt="NumOfLinkedObject.JPG.jpg" class="jive-image" src="https://community.qlik.com/legacyfs/online/47481_NumOfLinkedObject.JPG.jpg" style="width: 620px; height: 177px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Oct 2013 13:54:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Delete-Close-all-linked-object-by-macro-vb/m-p/513275#M191786</guid>
      <dc:creator />
      <dc:date>2013-10-10T13:54:09Z</dc:date>
    </item>
  </channel>
</rss>

