<?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 How to get the id of a currently selected object in a macro in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/How-to-get-the-id-of-a-currently-selected-object-in-a-macro/m-p/173422#M42609</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for that, pinongs et al.&lt;/P&gt;&lt;P&gt;I used your suggestions and got the result I wanted. Now I have one macro to maintain which knows which sheet it was called from and behaves accordingly.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 19 Jan 2011 02:26:41 GMT</pubDate>
    <dc:creator>beanmachine</dc:creator>
    <dc:date>2011-01-19T02:26:41Z</dc:date>
    <item>
      <title>How to get the id of a currently selected object in a macro</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-get-the-id-of-a-currently-selected-object-in-a-macro/m-p/173419#M42606</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a macro which writes out an export file and then prepends a heading to that file to match a proprietary import format. I want to use the same macro for a range of different objects (straight tables) using a button. Currently I am hard coding the ID for test purposes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The user will select the object they want and then hit export. The problem is, how do I tell my macro the id of the object the user has selected? I can't seem to find a API function for this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Appreciate any information on the subject.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;BeanMachine&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Jan 2011 09:36:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-get-the-id-of-a-currently-selected-object-in-a-macro/m-p/173419#M42606</guid>
      <dc:creator>beanmachine</dc:creator>
      <dc:date>2011-01-18T09:36:25Z</dc:date>
    </item>
    <item>
      <title>How to get the id of a currently selected object in a macro</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-get-the-id-of-a-currently-selected-object-in-a-macro/m-p/173420#M42607</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You may want to try using the IsActive property -- not sure if there is a property/method that returns activesheetobjects. Example below:&lt;/P&gt;&lt;P&gt;rem ** minimize all active sheet objects on active sheet **&lt;BR /&gt;set s=ActiveDocument.ActiveSheet&lt;BR /&gt;objs=s.GetSheetObjects&lt;BR /&gt;for i=lbound(objs) to ubound(objs)&lt;BR /&gt; if objs(i).IsActive then objs(i).Minimize&lt;BR /&gt;next&lt;/P&gt;&lt;P&gt;I hope this helps.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Jan 2011 09:51:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-get-the-id-of-a-currently-selected-object-in-a-macro/m-p/173420#M42607</guid>
      <dc:creator />
      <dc:date>2011-01-18T09:51:07Z</dc:date>
    </item>
    <item>
      <title>How to get the id of a currently selected object in a macro</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-get-the-id-of-a-currently-selected-object-in-a-macro/m-p/173421#M42608</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I used sir &lt;STRONG&gt;&lt;A href="http://community.qlik.com/members/pinongs/default.aspx"&gt;pinongs&lt;/A&gt;'&lt;/STRONG&gt; code as a basis:&lt;/P&gt;&lt;P&gt;you can try this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sub Test&lt;/P&gt;&lt;P&gt;set s=ActiveDocument.ActiveSheet&lt;/P&gt;&lt;P&gt;objs=s.GetSheetObjects&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for i=lbound(objs) to ubound(objs)&lt;/P&gt;&lt;P&gt;if objs(i).IsActive then&lt;/P&gt;&lt;P&gt;msgbox("Object Id: " &amp;amp; objs(i).GetObjectId)&lt;/P&gt;&lt;P&gt;ActiveDocument.Variables("vID").SetContent objs(i).GetObjectId,true&lt;/P&gt;&lt;P&gt;end if&lt;/P&gt;&lt;P&gt;next&lt;/P&gt;&lt;P&gt;End Sub&lt;/P&gt;&lt;P&gt;actually i just added a message box that will tell you the Id of the object that you selected and pass the Id to a variable &lt;B&gt;vID&lt;/B&gt;(you can use this variable in your export code)..&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Stick out tongue" src="http://community.qlik.com/emoticons/emotion-4.gif" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Jan 2011 01:55:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-get-the-id-of-a-currently-selected-object-in-a-macro/m-p/173421#M42608</guid>
      <dc:creator />
      <dc:date>2011-01-19T01:55:12Z</dc:date>
    </item>
    <item>
      <title>How to get the id of a currently selected object in a macro</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-get-the-id-of-a-currently-selected-object-in-a-macro/m-p/173422#M42609</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for that, pinongs et al.&lt;/P&gt;&lt;P&gt;I used your suggestions and got the result I wanted. Now I have one macro to maintain which knows which sheet it was called from and behaves accordingly.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Jan 2011 02:26:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-get-the-id-of-a-currently-selected-object-in-a-macro/m-p/173422#M42609</guid>
      <dc:creator>beanmachine</dc:creator>
      <dc:date>2011-01-19T02:26:41Z</dc:date>
    </item>
  </channel>
</rss>

