<?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 problem.. in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/MAcro-problem/m-p/163197#M504971</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Rakesh.. sensible data .. I cannot..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 21 Aug 2009 14:02:30 GMT</pubDate>
    <dc:creator />
    <dc:date>2009-08-21T14:02:30Z</dc:date>
    <item>
      <title>MAcro problem..</title>
      <link>https://community.qlik.com/t5/QlikView/MAcro-problem/m-p/163194#M504968</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Guys,&lt;/P&gt;&lt;P&gt;A question related to Macro.. I have a vStichtag as a variable and for example is assigned as a date '31.12.2008'&lt;/P&gt;&lt;P&gt;By selecting this date I select all the values which are '31.12.2008'&amp;lt;=Table.BEGDA and '31.12.2008' &amp;gt;=Table.ENDDA&lt;/P&gt;&lt;P&gt;I resignate the Macro selectstichtag1 to Vstichtag in the Properties of the documents-&amp;gt; macros-&amp;gt;Variable&lt;/P&gt;&lt;P&gt;I set a variable l_tabellen_stichtag1_gesteuert in skript to all the tables which I want to loop in the macro according to the variable '31.12.2008'&lt;/P&gt;&lt;P&gt;ActiveDocument.Fields(fieldname).Unlock at this position I am getting a error..&lt;/P&gt;&lt;P&gt;can u pls help and tell whether the code is correct?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;PRE&gt;&lt;/PRE&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;sub SelectStichtag&lt;BR /&gt; set v = ActiveDocument.Variables("vStichtag")&lt;BR /&gt; x = "&amp;lt;=" &amp;amp; v.GetContent.String&lt;BR /&gt; SelectAndLock "Table1.BEGDA",x&lt;BR /&gt; SelectAndLock "Table2.BEGDA",x&lt;BR /&gt; SelectAndLock "Table3.BEGDA",x&lt;BR /&gt; SelectAndLock "Table4.BEGDA",x&lt;BR /&gt; SelectAndLock "Table5.BEGDA",x&lt;BR /&gt; SelectAndLock "Table6.BEGDA",x&lt;BR /&gt; SelectAndLock "Table7.BEGDA",x&lt;BR /&gt; SelectAndLock "Table8.BEGDA",x&lt;BR /&gt; SelectAndLock "Table9.BEGDA",x&lt;BR /&gt; SelectAndLock "Table10.BEGDA",x&lt;BR /&gt; SelectAndLock "Table11.BEGDA",x&lt;BR /&gt; SelectAndLock "Table12.BEGDA",x&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt; x = "&amp;gt;=" &amp;amp; v.GetContent.String&lt;BR /&gt; SelectAndLock "Table1.ENDDA",x&lt;BR /&gt; SelectAndLock "Table2.ENDDA",x&lt;BR /&gt; SelectAndLock "Table3.ENDDA",x&lt;BR /&gt; SelectAndLock "Table4.ENDDA",x&lt;BR /&gt; SelectAndLock "Table5.ENDDA",x&lt;BR /&gt; SelectAndLock "Table6.ENDDA",x&lt;BR /&gt; SelectAndLock "Table7.ENDDA",x&lt;BR /&gt; SelectAndLock "Table8.ENDDA",x&lt;BR /&gt; SelectAndLock "Table9.ENDDA",x&lt;BR /&gt; SelectAndLock "Table10.ENDDA",x&lt;BR /&gt; SelectAndLock "Table11.ENDDA",x&lt;BR /&gt; SelectAndLock "Table12.ENDDA",x&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;end sub&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;sub selectStichtag1&lt;BR /&gt;&lt;BR /&gt; dim i_tabellenliste, a_tabelle, i_tabelle, i_feld&lt;BR /&gt; dim i_selektion_begda, i_selektion_endda, i_stichtag&lt;BR /&gt;&lt;BR /&gt; i_stichtag = ActiveDocument.Variables("vStichtag")_&lt;BR /&gt; .getContent.String&lt;BR /&gt;&lt;BR /&gt; i_tabellenliste = ActiveDocument.Variables("l_tabellen_stichtag1_gesteuert")_&lt;BR /&gt; .getContent.String&lt;BR /&gt;&lt;BR /&gt; a_tabelle = split(i_tabellenliste,",")&lt;BR /&gt;&lt;BR /&gt; i_selektion_begda = "&amp;lt;=" &amp;amp; i_stichtag&lt;BR /&gt; i_selektion_endda = "&amp;gt;=" &amp;amp; i_stichtag&lt;BR /&gt;&lt;BR /&gt; for each i_tabelle in a_tabelle&lt;BR /&gt; i_tabelle = trim(i_tabelle)&lt;BR /&gt; i_feld = i_tabelle &amp;amp; ".BEGDA"&lt;BR /&gt; call SelectAndLock (i_feld,i_selektion_begda)&lt;BR /&gt; i_feld = i_tabelle &amp;amp; ".ENDDA"&lt;BR /&gt; call SelectAndLock (i_feld,i_selektion_endda)&lt;BR /&gt;&lt;BR /&gt; next&lt;BR /&gt;&lt;BR /&gt;end sub&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;sub SelectAndLock (fieldname, selection)&lt;BR /&gt;ActiveDocument.Fields(fieldname).Unlock&lt;BR /&gt;ActiveDocument.Fields(fieldname).Clear&lt;BR /&gt;ActiveDocument.Fields(fieldname).Select selection,true,1&lt;BR /&gt;ActiveDocument.Fields(fieldname).Lock&lt;BR /&gt;end sub&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;&lt;P&gt;sravan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Aug 2009 21:39:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/MAcro-problem/m-p/163194#M504968</guid>
      <dc:creator />
      <dc:date>2009-08-20T21:39:31Z</dc:date>
    </item>
    <item>
      <title>MAcro problem..</title>
      <link>https://community.qlik.com/t5/QlikView/MAcro-problem/m-p/163195#M504969</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;[View:http://community.qlik.com/cfs-file.ashx/__key/CommunityServer.Discussions.Components.Files/11/0474.Dok1.doc:550:0]&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Aug 2009 21:50:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/MAcro-problem/m-p/163195#M504969</guid>
      <dc:creator />
      <dc:date>2009-08-20T21:50:54Z</dc:date>
    </item>
    <item>
      <title>MAcro problem..</title>
      <link>https://community.qlik.com/t5/QlikView/MAcro-problem/m-p/163196#M504970</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you post a sample qvw here?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Aug 2009 23:00:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/MAcro-problem/m-p/163196#M504970</guid>
      <dc:creator>disqr_rm</dc:creator>
      <dc:date>2009-08-20T23:00:45Z</dc:date>
    </item>
    <item>
      <title>MAcro problem..</title>
      <link>https://community.qlik.com/t5/QlikView/MAcro-problem/m-p/163197#M504971</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Rakesh.. sensible data .. I cannot..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Aug 2009 14:02:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/MAcro-problem/m-p/163197#M504971</guid>
      <dc:creator />
      <dc:date>2009-08-21T14:02:30Z</dc:date>
    </item>
    <item>
      <title>AW:Re: MAcro problem..</title>
      <link>https://community.qlik.com/t5/QlikView/MAcro-problem/m-p/163198#M504972</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;at first sight I would say: the function SelectAndLock must get an invalid parameter "fieldname"; I could imagine that one time i_tabelle is empty and so parameter is ".BEGDA" - so this invalid field cannot be unlocked (hence "Objekt erforderlich ..."). That would be my first suspicion. Perhaps you should debug the i_tabelle or the fieldname-parameter with MsgBox to check.&lt;/P&gt;&lt;P&gt;Rgds,&lt;BR /&gt;Joachim&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 22 Aug 2009 00:31:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/MAcro-problem/m-p/163198#M504972</guid>
      <dc:creator>biester</dc:creator>
      <dc:date>2009-08-22T00:31:12Z</dc:date>
    </item>
    <item>
      <title>AW:Re: MAcro problem..</title>
      <link>https://community.qlik.com/t5/QlikView/MAcro-problem/m-p/163199#M504973</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;@ Biester&lt;/P&gt;&lt;P&gt;Thanks for the explanation.. I think u r explanation makes sense. How can I change the code to get the correct data with out getting this "Object erforderlich..." and I did not debug in Macro untill now.. I need to see how to do it if any explanation is there in handbook..&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Aug 2009 16:50:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/MAcro-problem/m-p/163199#M504973</guid>
      <dc:creator />
      <dc:date>2009-08-24T16:50:14Z</dc:date>
    </item>
    <item>
      <title>AW:Re: AW:Re: MAcro problem..</title>
      <link>https://community.qlik.com/t5/QlikView/MAcro-problem/m-p/163200#M504974</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sravan,&lt;/P&gt;&lt;P&gt;I'd suggest to simply check the parameters and slightly modify your sub as follows (hope I made no mistake here):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;sub SelectAndLock (fieldname, selection)&lt;BR /&gt;&lt;STRONG&gt;'this is the line to check what parameters this sub really receives&lt;BR /&gt;MsgBox "Field: " &amp;amp; fieldname &amp;amp; " - selection: " &amp;amp; selection&lt;BR /&gt;&lt;/STRONG&gt;ActiveDocument.Fields(fieldname).Unlock&lt;BR /&gt;ActiveDocument.Fields(fieldname).Clear&lt;BR /&gt;ActiveDocument.Fields(fieldname).Select selection,true,1&lt;BR /&gt;ActiveDocument.Fields(fieldname).Lock&lt;BR /&gt;end sub&lt;BR /&gt;&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;Let's try what the MsgBox tells us ... Hope this helps,&lt;/P&gt;&lt;P&gt;Rgds,&lt;BR /&gt;Joachim&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Aug 2009 17:05:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/MAcro-problem/m-p/163200#M504974</guid>
      <dc:creator>biester</dc:creator>
      <dc:date>2009-08-24T17:05:28Z</dc:date>
    </item>
    <item>
      <title>AW:Re: AW:Re: MAcro problem..</title>
      <link>https://community.qlik.com/t5/QlikView/MAcro-problem/m-p/163201#M504975</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;@Biester&lt;/P&gt;&lt;P&gt;That was great. Ya the macro selects the list of tables and this msgBox works.. After all the tables are finished it lands again at the line(Below given) with the Problem "Object erforderlich...". That means what you said was correct. The Invalid field cannot be unlocked when the I_tabelle is empty. What can be done here??&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;&lt;BR /&gt;ActiveDocument.Fields(fieldname).Unlock&lt;BR /&gt;&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;Thanks for the response.. That helped me a lot..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Aug 2009 18:16:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/MAcro-problem/m-p/163201#M504975</guid>
      <dc:creator />
      <dc:date>2009-08-24T18:16:56Z</dc:date>
    </item>
    <item>
      <title>AW:Re: AW:Re: AW:Re: MAcro problem..</title>
      <link>https://community.qlik.com/t5/QlikView/MAcro-problem/m-p/163202#M504976</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sravan,&lt;/P&gt;&lt;P&gt;well, if I analyze the thing right, the situation might be thus:&lt;/P&gt;&lt;P&gt;You have variable l_tabellen_stichtag1_gesteuert, where you have a list of the needed tables, separated by comma.&lt;BR /&gt;You read this QV-Variable into the VBScript variable i_tabellenliste and then split it. If i_tabelle is empty (I assume it's the last one), then the variable ends with a comma, meaning it must look like:&lt;BR /&gt;"Tabelle1,Tabelle2,Tabelle3,"&lt;BR /&gt;So the split(i_tabellenliste,",") delivers an array with four elements: Tabelle1,Tabelle2,Tabelle3 AND NULL (because after the last comma there is NOTHING).&lt;/P&gt;&lt;P&gt;So I'd suggest you check this. Perhaps as so often the solution lies in a comma too much ;-).&lt;/P&gt;&lt;P&gt;Rgds,&lt;BR /&gt;Joachim&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Aug 2009 18:33:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/MAcro-problem/m-p/163202#M504976</guid>
      <dc:creator>biester</dc:creator>
      <dc:date>2009-08-24T18:33:25Z</dc:date>
    </item>
    <item>
      <title>AW:Re: AW:Re: AW:Re: MAcro problem..</title>
      <link>https://community.qlik.com/t5/QlikView/MAcro-problem/m-p/163203#M504977</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Joachim,&lt;/P&gt;&lt;P&gt;It seems reasonable what you said and the explanation with&lt;/P&gt;&lt;P&gt;I_tabellen_stichtag1_gesteuert is correct. But the problem is not with a comma. everything seems to be correct in the I_tabellen_stichtag1_gesteuert and still the same problem &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;&lt;P&gt;By the way very good interpretation &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Aug 2009 19:33:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/MAcro-problem/m-p/163203#M504977</guid>
      <dc:creator />
      <dc:date>2009-08-24T19:33:41Z</dc:date>
    </item>
    <item>
      <title>AW:Re: AW:Re: AW:Re: AW:Re: MAcro problem..</title>
      <link>https://community.qlik.com/t5/QlikView/MAcro-problem/m-p/163204#M504978</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sravan,&lt;/P&gt;&lt;P&gt;can you hear my brains working ? I'm almost getting a "Hirnkrampf" imagining what else it could be &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;&lt;P&gt;It would be very helpful to know the exact value of the ominous variable I_tabellen_stichtag1_gesteuert, perhaps I can see there what I can't think of now. Could you perhaps post it, I think it won't contain to much sensible data, does it?&lt;/P&gt;&lt;P&gt;Rgds,&lt;BR /&gt;Joachim&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Aug 2009 19:50:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/MAcro-problem/m-p/163204#M504978</guid>
      <dc:creator>biester</dc:creator>
      <dc:date>2009-08-24T19:50:21Z</dc:date>
    </item>
  </channel>
</rss>

