<?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 Need VBScript advise in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Need-VBScript-advise/m-p/145919#M24564</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;this is exactly what I needed! works like a champ!&lt;/P&gt;&lt;P&gt;thanks a bunch!&lt;/P&gt;&lt;P&gt;Oleg&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 05 Jun 2009 02:14:35 GMT</pubDate>
    <dc:creator>Oleg_Troyansky</dc:creator>
    <dc:date>2009-06-05T02:14:35Z</dc:date>
    <item>
      <title>Need VBScript advise</title>
      <link>https://community.qlik.com/t5/QlikView/Need-VBScript-advise/m-p/145917#M24562</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Folks,&lt;/P&gt;&lt;P&gt;my turn to ask a question [;)] Michael, Rob or perhaps other VBScript gurus - please help me script the following:&lt;/P&gt;&lt;P&gt;I have a chart with several definitions presented as variables. All relevant variables have a single substring in common. For example:&lt;/P&gt;&lt;P&gt;exp_Oleg_1, exp_Oleg_2, lbl_Oleg_1, lbl_Oleg_2&lt;/P&gt;&lt;P&gt;I'd like to clone the object and replace the common string by another common string in the target chart. For example, instead of the 4 variables above, have the new variable names:&lt;/P&gt;&lt;P&gt;exp_Rob_1, exp_Rob_2, etc...&lt;/P&gt;&lt;P&gt;I was thinking along the following lines:&lt;/P&gt;&lt;P&gt;1. Export XML definitions of the "source object"&lt;/P&gt;&lt;P&gt;2. Read the XML file within the script and replace one substring by another everywhere&lt;/P&gt;&lt;P&gt;3. Create new object from the XML file&lt;/P&gt;&lt;P&gt;My scription knowledge ends at number 1 or 3. I don't know how to accomplish #2. Any ideas?&lt;/P&gt;&lt;P&gt;thanks in advance!&lt;/P&gt;&lt;P&gt;Oleg&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Jun 2009 23:26:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Need-VBScript-advise/m-p/145917#M24562</guid>
      <dc:creator>Oleg_Troyansky</dc:creator>
      <dc:date>2009-06-04T23:26:44Z</dc:date>
    </item>
    <item>
      <title>Need VBScript advise</title>
      <link>https://community.qlik.com/t5/QlikView/Need-VBScript-advise/m-p/145918#M24563</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Oleg,&lt;/P&gt;&lt;P&gt;Interesting question, had to throw together an example. In this case I used a text box object and added a variable as value called v_Test.&lt;/P&gt;&lt;P&gt;My macro exports the object to XML, parses through it and changes all v_Test to v_NewTest and writes the text into a new XML file which I then load as an object into QV again. This of course needs system access allowed. It can probably be done in a nicer way though without having to write two files to disk but I'm lazy sometimes.&lt;/P&gt;&lt;P&gt;Macro:&lt;/P&gt;&lt;P&gt;sub test&lt;BR /&gt;ActiveDocument.GetSheetObject( "TX01" ).WriteXmlPropertiesFile "C:\MychartProp.xml"&lt;/P&gt;&lt;P&gt;Const ForReading = 1&lt;BR /&gt;Const ForWriting = 2&lt;/P&gt;&lt;P&gt;Set objFSO = CreateObject("Scripting.FileSystemObject")&lt;BR /&gt;Set objFile = objFSO.OpenTextFile("C:\MychartProp.xml", ForReading)&lt;/P&gt;&lt;P&gt;strText = objFile.ReadAll&lt;BR /&gt;objFile.Close&lt;BR /&gt;strNewText = Replace(strText, "v_Test", "v_NewTest")&lt;/P&gt;&lt;P&gt;Set objFile = objFSO.CreateTextFile("C:\MyNewChartProp.xml", ForWriting)&lt;BR /&gt;objFile.WriteLine strNewText&lt;BR /&gt;objFile.Close&lt;/P&gt;&lt;P&gt;ActiveDocument.ActiveSheet.CreateObjectFromXmlPropertiesFile "C:\MyNewChartProp.xml"&lt;/P&gt;&lt;P&gt;end sub&lt;/P&gt;&lt;P&gt;Also, the new object is pasted right on top of the old one which confused me before I moved it and found the other one under it &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>Fri, 05 Jun 2009 01:33:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Need-VBScript-advise/m-p/145918#M24563</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-06-05T01:33:29Z</dc:date>
    </item>
    <item>
      <title>Need VBScript advise</title>
      <link>https://community.qlik.com/t5/QlikView/Need-VBScript-advise/m-p/145919#M24564</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;this is exactly what I needed! works like a champ!&lt;/P&gt;&lt;P&gt;thanks a bunch!&lt;/P&gt;&lt;P&gt;Oleg&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Jun 2009 02:14:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Need-VBScript-advise/m-p/145919#M24564</guid>
      <dc:creator>Oleg_Troyansky</dc:creator>
      <dc:date>2009-06-05T02:14:35Z</dc:date>
    </item>
  </channel>
</rss>

