<?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: macro for script tab in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/macro-for-script-tab/m-p/369496#M137391</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello, I have read your posted and I founded very useful for me.&lt;/P&gt;&lt;P&gt;No I have another question;&lt;/P&gt;&lt;P&gt;How can y delete an specific tab using a macro.&lt;/P&gt;&lt;P&gt;Let say we have three tabs: main, main2 and main3 and I want to delete main2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;&lt;P&gt;Marcelo&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 03 Aug 2012 12:14:35 GMT</pubDate>
    <dc:creator />
    <dc:date>2012-08-03T12:14:35Z</dc:date>
    <item>
      <title>macro for script tab</title>
      <link>https://community.qlik.com/t5/QlikView/macro-for-script-tab/m-p/369490#M137385</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'm using below macro code it is working fine, but i am trying to place the "Load * from abc.csv;" in a particular tab i.e; main2 tab.&lt;/P&gt;&lt;P&gt;how can i change the macro code to acheive this ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;rem ** add new line to script **&lt;/P&gt;&lt;P&gt;set docprop = ActiveDocument.GetProperties&lt;/P&gt;&lt;P&gt;docprop.Script = docprop.Script &amp;amp; "Load * from abc.csv;" //this should be present in main2 tab in edit script&lt;/P&gt;&lt;P&gt;ActiveDocument.SetProperties docprop&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Mar 2012 15:50:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/macro-for-script-tab/m-p/369490#M137385</guid>
      <dc:creator />
      <dc:date>2012-03-26T15:50:10Z</dc:date>
    </item>
    <item>
      <title>macro for script tab</title>
      <link>https://community.qlik.com/t5/QlikView/macro-for-script-tab/m-p/369491#M137386</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;sounds to me as if you have to parse the text which is in docprop.Script.&lt;BR /&gt;If you look at the script in debug mode, you see that the tabs are resolved, all code is "one long text". &lt;BR /&gt;The tabs are marked with triple-slash, like ///$tab Main&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;So adding a new tab at the end of the existing code should work like&lt;/P&gt;&lt;P&gt;docprop.Script = docprop.Script &amp;amp; chr(13) &amp;amp; chr(10) &amp;amp; "///$tab Main2" &amp;amp; chr(13) &amp;amp; chr(10) &amp;amp; "Load * from abc.csv;" &lt;/P&gt;&lt;P&gt;(I am not sure about adding a new line/ the CRLF)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you want to add the code on an existing tab, you have to find the tab marker of the FOLLOWING tab, cut the script there, add your code, glue the rest of the script.&lt;BR /&gt;done.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sounds good, but honestly I have not tested it &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hth,&lt;BR /&gt;Thilo&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Mar 2012 16:45:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/macro-for-script-tab/m-p/369491#M137386</guid>
      <dc:creator />
      <dc:date>2012-03-26T16:45:18Z</dc:date>
    </item>
    <item>
      <title>Re: macro for script tab</title>
      <link>https://community.qlik.com/t5/QlikView/macro-for-script-tab/m-p/369492#M137387</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your reply.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried your code it is creating new tab "Main2" and adding the script line in it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But what i am trying is it should not create new tab "Main2" tab bcoz there is already exist that "Main2" tab. so it shoud add the script line in existed tab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I didn't get your procedure on existed tab , please can you explain little more clear or otherwise can you provide the example.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What i needs to change in below line for to add in existed tab.&lt;/P&gt;&lt;P&gt;docprop.Script = docprop.Script &amp;amp; chr(13) &amp;amp; chr(10) &amp;amp; "///$tab Main 2" &amp;amp; chr(13) &amp;amp; chr(10) &amp;amp; "$(Include=d:\vqd eat\text\test.txt);"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Mar 2012 07:11:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/macro-for-script-tab/m-p/369492#M137387</guid>
      <dc:creator />
      <dc:date>2012-03-27T07:11:37Z</dc:date>
    </item>
    <item>
      <title>Re: macro for script tab</title>
      <link>https://community.qlik.com/t5/QlikView/macro-for-script-tab/m-p/369493#M137388</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;please can anyone provide the suggestion on this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Mar 2012 09:52:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/macro-for-script-tab/m-p/369493#M137388</guid>
      <dc:creator />
      <dc:date>2012-03-27T09:52:14Z</dc:date>
    </item>
    <item>
      <title>macro for script tab</title>
      <link>https://community.qlik.com/t5/QlikView/macro-for-script-tab/m-p/369494#M137389</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;let's say you have three tabs: main, main2 and main3.&lt;/P&gt;&lt;P&gt;You want to add code at the end of main2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To find the position of main3 in the script, you need to use the VBScript Instr function:&lt;BR /&gt;pos = InStr(docprop.Script,"///$tab main3")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you want to leave the code till there untouched:&lt;BR /&gt;code = left(docprop.Script,pos-1)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;now add your new code:&lt;BR /&gt;code = code &amp;amp; chr(13) &amp;amp; chr(10) &amp;amp; "whatever code you like" &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;now add the rest of the original code:&lt;BR /&gt;code = code &amp;amp; chr(13) &amp;amp; chr(10) &amp;amp; right(docprop.Script, len(docprop.Script)-pos+1)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;finally replace the script code:&lt;BR /&gt;docprop.Script = code&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I hope that points you in the right direction,&lt;BR /&gt;Thilo&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Mar 2012 13:46:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/macro-for-script-tab/m-p/369494#M137389</guid>
      <dc:creator />
      <dc:date>2012-03-29T13:46:55Z</dc:date>
    </item>
    <item>
      <title>Re: macro for script tab</title>
      <link>https://community.qlik.com/t5/QlikView/macro-for-script-tab/m-p/369495#M137390</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello, I have read your posted and I founded very useful for me.&lt;/P&gt;&lt;P&gt;No I have another question;&lt;/P&gt;&lt;P&gt;How can y delete an specific tab using a macro.&lt;/P&gt;&lt;P&gt;Let say we have three tabs: main, main2 and main3 and I want to delete main2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;&lt;P&gt;Marcelo&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Aug 2012 12:14:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/macro-for-script-tab/m-p/369495#M137390</guid>
      <dc:creator />
      <dc:date>2012-08-03T12:14:26Z</dc:date>
    </item>
    <item>
      <title>Re: macro for script tab</title>
      <link>https://community.qlik.com/t5/QlikView/macro-for-script-tab/m-p/369496#M137391</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello, I have read your posted and I founded very useful for me.&lt;/P&gt;&lt;P&gt;No I have another question;&lt;/P&gt;&lt;P&gt;How can y delete an specific tab using a macro.&lt;/P&gt;&lt;P&gt;Let say we have three tabs: main, main2 and main3 and I want to delete main2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;&lt;P&gt;Marcelo&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Aug 2012 12:14:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/macro-for-script-tab/m-p/369496#M137391</guid>
      <dc:creator />
      <dc:date>2012-08-03T12:14:35Z</dc:date>
    </item>
  </channel>
</rss>

