<?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: Basic vbScript help in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Basic-vbScript-help/m-p/377839#M140874</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Not quite sure I understand what you are trying to do but the following macro will simply create and write to a text file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can set the vFullPath variable in the Document QV script or from Document &amp;gt; Settimgs &amp;gt; Vaiable Overview.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Npte the vFullPath needs the directory and file name. e.g. c:\temp\myfile.txt&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;sub CreateTextOutput&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set v = ActiveDocument.Variables("vFullPath")&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; vLocalPath = v.GetContent.String&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set objFSO = CreateObject("Scripting.FileSystemObject")&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set FileStream = objFSO.OpenTextFile(vLocalPath, 2, true) 'Change 2 to 8 for append&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FileStream.WriteLine("xxxx")&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FileStream.Close()&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;end sub &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 14 Aug 2012 20:52:27 GMT</pubDate>
    <dc:creator>tom_tierney</dc:creator>
    <dc:date>2012-08-14T20:52:27Z</dc:date>
    <item>
      <title>Basic vbScript help</title>
      <link>https://community.qlik.com/t5/QlikView/Basic-vbScript-help/m-p/377838#M140873</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;Trying to do something simple (or so I thought) but not working and possibly going to send me over the edge....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm trying to write a line out to a text file but both looking at the example in the API Guide and in the few forum posts here I still can't get anything to output.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here's what I'm doing:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sub CreateTextOutput&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;set v = ActiveDocument.Variables("vFullPath")&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;vLocalPath = v.GetContent.String&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Set objFSO = CreateObject("Scripting.FileSystemObject")&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Set objFile = objFSO.CreateTextFile(vLocalPath, true)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;'Export Header Line and spacing line&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;set FileStream = objFile.OpenAsTextStream(8)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;FileStream.WriteLine vLocalPath&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;FileStream.WriteBlankLines 1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;FileStream.Close&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;objFile.Close&lt;/P&gt;&lt;P&gt;end sub&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;where vFullPath is set to a file location on my local hard drive.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The result is that I get the file created in the location but with nothing in the file itself.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anyone see what I'm doing wrong?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Chris&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Aug 2012 15:10:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Basic-vbScript-help/m-p/377838#M140873</guid>
      <dc:creator>chris_johnson</dc:creator>
      <dc:date>2012-08-14T15:10:48Z</dc:date>
    </item>
    <item>
      <title>Re: Basic vbScript help</title>
      <link>https://community.qlik.com/t5/QlikView/Basic-vbScript-help/m-p/377839#M140874</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Not quite sure I understand what you are trying to do but the following macro will simply create and write to a text file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can set the vFullPath variable in the Document QV script or from Document &amp;gt; Settimgs &amp;gt; Vaiable Overview.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Npte the vFullPath needs the directory and file name. e.g. c:\temp\myfile.txt&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;sub CreateTextOutput&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set v = ActiveDocument.Variables("vFullPath")&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; vLocalPath = v.GetContent.String&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set objFSO = CreateObject("Scripting.FileSystemObject")&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set FileStream = objFSO.OpenTextFile(vLocalPath, 2, true) 'Change 2 to 8 for append&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FileStream.WriteLine("xxxx")&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FileStream.Close()&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;end sub &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Aug 2012 20:52:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Basic-vbScript-help/m-p/377839#M140874</guid>
      <dc:creator>tom_tierney</dc:creator>
      <dc:date>2012-08-14T20:52:27Z</dc:date>
    </item>
    <item>
      <title>Re: Basic vbScript help</title>
      <link>https://community.qlik.com/t5/QlikView/Basic-vbScript-help/m-p/377840#M140875</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Haven't used vbscript in awhile but do you need to specify an append mode? Would the last WriteBlankLines be overwriting the vLocalPath line already added. Just a guess.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FileStream.WriteLine vLocalPath&lt;/P&gt;&lt;P&gt;FileStream.WriteBlankLines 1&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Aug 2012 01:15:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Basic-vbScript-help/m-p/377840#M140875</guid>
      <dc:creator>jeremy_fourman</dc:creator>
      <dc:date>2012-08-15T01:15:48Z</dc:date>
    </item>
    <item>
      <title>Re: Basic vbScript help</title>
      <link>https://community.qlik.com/t5/QlikView/Basic-vbScript-help/m-p/377841#M140876</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi both,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Yes Tom, you are correct in so far as I'm just trying to write a line out to a text file. In the end I'm trying to create a text file with a header row, a blank line and then the contents of a straight table. The file is for importing into a seperate system (Hyperion).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I ended up getting somewhere this morning by not using the File Stream object at all and just doing a file.writeline.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Jeremy, you are correct in what you are saying too in that I will write a line out to a file and then use an append function to add chart data to it. I tried to use chart.AppendExport but ended up getting html out instead of the data itself which was a bit confusing; especially since I used the chart.Export function previously to test out the result and got all of the data out as I wanted it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Going to keep plugging away at it, using macros is proving to be a bit of a nightmare though.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Chris&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Aug 2012 09:23:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Basic-vbScript-help/m-p/377841#M140876</guid>
      <dc:creator>chris_johnson</dc:creator>
      <dc:date>2012-08-15T09:23:45Z</dc:date>
    </item>
  </channel>
</rss>

