<?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: How to save a excel file with filename as current selection in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/How-to-save-a-excel-file-with-filename-as-current-selection/m-p/442414#M1162864</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Also I used following to default 'No Selection' to filename 'Overall'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;= IF((Nullcount (SubStringCount( GetCurrentSelections(':'),':'))),'Overall',replace(replace(GetCurrentSelections(),': ','_'),chr(13)&amp;amp;chr(10),'_'))&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 17 Nov 2012 07:14:01 GMT</pubDate>
    <dc:creator>jiwaniakbiar</dc:creator>
    <dc:date>2012-11-17T07:14:01Z</dc:date>
    <item>
      <title>How to save a excel file with filename as current selection</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-save-a-excel-file-with-filename-as-current-selection/m-p/442410#M1162860</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;I need help to save excel with Current Selection as file name. Also if there is nothing selected, it should save as default name&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried to setup a variable which will hold current selection value and use it in the macro but it doesn't work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Varialbe declared in Document Properties as:&lt;/P&gt;&lt;P&gt;vSelection = (replace(GetCurrentSelections(),': ','_')&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and Macro is:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;set v = ActiveDocument.Variables("vSelection")&lt;/P&gt;&lt;P&gt;Selection = v.GetContent.String&lt;/P&gt;&lt;P&gt;Path = "C:\qlikview\"&lt;/P&gt;&lt;P&gt;FileName = Selection &amp;amp; "_Report" &amp;amp; ".xlsx"&lt;/P&gt;&lt;P&gt;ActiveDocument.Sheets("REC Dashboard").Activate&lt;/P&gt;&lt;P&gt;MsgBox(FileName)&lt;/P&gt;&lt;P&gt;objExcelWorkbook.SaveAs Path &amp;amp; FileName&lt;/P&gt;&lt;P&gt;MsgBox("File Saved Successfully in C:\qlikview\"+Selection+".xls")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It works for a single fiield is selected. If I have more than one Field selected, it doesn't work because vSelection sends string in two lines&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Nov 2012 20:13:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-save-a-excel-file-with-filename-as-current-selection/m-p/442410#M1162860</guid>
      <dc:creator>jiwaniakbiar</dc:creator>
      <dc:date>2012-11-16T20:13:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to save a excel file with filename as current selection</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-save-a-excel-file-with-filename-as-current-selection/m-p/442411#M1162861</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try:&lt;/P&gt;&lt;P&gt;vSelection = replace(replace(GetCurrentSelections(),': ','_'),chr(13)chr(10),'_') &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Nov 2012 20:21:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-save-a-excel-file-with-filename-as-current-selection/m-p/442411#M1162861</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2012-11-16T20:21:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to save a excel file with filename as current selection</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-save-a-excel-file-with-filename-as-current-selection/m-p/442412#M1162862</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It worked. Thnx. However can you please help me what exactly you did with chr(13) and chr(10)?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 17 Nov 2012 06:56:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-save-a-excel-file-with-filename-as-current-selection/m-p/442412#M1162862</guid>
      <dc:creator>jiwaniakbiar</dc:creator>
      <dc:date>2012-11-17T06:56:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to save a excel file with filename as current selection</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-save-a-excel-file-with-filename-as-current-selection/m-p/442413#M1162863</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Getcurrentselections inserts a linebreak between the results of different fields. The linebreak consists of two ascii characters, a Carriage Return (chr 13) and a Line Feed (chr 10). I replaced them with an underscore '_'. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 17 Nov 2012 07:01:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-save-a-excel-file-with-filename-as-current-selection/m-p/442413#M1162863</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2012-11-17T07:01:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to save a excel file with filename as current selection</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-save-a-excel-file-with-filename-as-current-selection/m-p/442414#M1162864</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Also I used following to default 'No Selection' to filename 'Overall'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;= IF((Nullcount (SubStringCount( GetCurrentSelections(':'),':'))),'Overall',replace(replace(GetCurrentSelections(),': ','_'),chr(13)&amp;amp;chr(10),'_'))&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 17 Nov 2012 07:14:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-save-a-excel-file-with-filename-as-current-selection/m-p/442414#M1162864</guid>
      <dc:creator>jiwaniakbiar</dc:creator>
      <dc:date>2012-11-17T07:14:01Z</dc:date>
    </item>
  </channel>
</rss>

