<?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 to save file with specified Tab Name and File Name in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Macro-to-save-file-with-specified-Tab-Name-and-File-Name/m-p/87132#M14256</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Phalgun,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have a look at the updated file.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 06 Sep 2018 12:23:21 GMT</pubDate>
    <dc:creator>tamilarasu</dc:creator>
    <dc:date>2018-09-06T12:23:21Z</dc:date>
    <item>
      <title>Macro to save file with specified Tab Name and File Name</title>
      <link>https://community.qlik.com/t5/QlikView/Macro-to-save-file-with-specified-Tab-Name-and-File-Name/m-p/87127#M14251</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm trying to use a macro to export a chart object to an excel file. The restrictions however are that the file name should be 'Manpower_Project Name.xlsx' where Project Name is derived from a variable ("vProjectName") within the QV dashboard.The tab (Sheet) name should be 'Manpower'. Also, the file should get saved in the same folder location as the QV file. I tried combining some macros I found online as I'm not very familiar with VBscript. Here's the macro I tried:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_15359683335752206" jivemacro_uid="_15359683335752206"&gt;
&lt;P&gt;Sub ExportExcel&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;'Report Month&lt;/P&gt;
&lt;P&gt;'// Array for export definitions&lt;/P&gt;
&lt;P&gt;set Name1 = ActiveDocument.Variables("vProjectName")&lt;/P&gt;
&lt;P&gt;ProjectName = replace(Name1.GetContent.String," ","_")&amp;nbsp; ' This will be used in file name with _&lt;/P&gt;
&lt;P&gt;mProjectName = Name1.GetContent.String ' This will be used in Excel Title&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;tmpPath = ActiveDocument.GetPathName&lt;/P&gt;
&lt;P&gt;lastBackSlash = InStrRev( tmpPath , "\" )&lt;/P&gt;
&lt;P&gt;path = Left( tmpPath , (lastBackSlash - 1) )&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;set obj = ActiveDocument.GetSheetObject("CH511")&lt;/P&gt;
&lt;P&gt;Name1 = "vProjectName"&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Dim aryExport(0,3)&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;aryExport(0,0) = "CH511"&lt;/P&gt;
&lt;P&gt;aryExport(0,1) = "MANPOWER"&lt;/P&gt;
&lt;P&gt;aryExport(0,2) = "A1"&lt;/P&gt;
&lt;P&gt;aryExport(0,3) = "data"&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;set XLApp = CreateObject("Excel.Application")&lt;/P&gt;
&lt;P&gt;XLApp.Visible = true&lt;/P&gt;
&lt;P&gt;XLApp.DisplayAlerts = False&lt;/P&gt;
&lt;P&gt;Dim XLAppgg 'as Excel.Workbook&lt;/P&gt;
&lt;P&gt;Set XLAppgg = XLApp.Workbooks.Add&lt;/P&gt;
&lt;P&gt;Set XLAppgg = copyObjectsToExcelSheet(ActiveDocument, aryExport)&lt;/P&gt;
&lt;P&gt;XLApp.ActiveWorkbook.Saveas ""&amp;amp; path &amp;amp;"\Manpower Benchmark_"&amp;amp; ProjectName &amp;amp;".xlsx"&lt;/P&gt;
&lt;P&gt;Msgbox("Export to Excel is completed and saved as Manpower Benchmark_"&amp;amp; ProjectName &amp;amp;".xlsx") ',vbSystemModal + vbInformation,"Export Status"&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;
&lt;P&gt;End sub&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;&lt;/P&gt;


&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But it doesn't seem to be correct as it doesn't work. Please help me make the required changes or suggest a script. Thanks in advance! Attaching the QV file for your reference. &lt;A href="https://community.qlik.com/qlik-users/178253"&gt;tamilarasu&lt;/A&gt;‌&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Sep 2018 09:56:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macro-to-save-file-with-specified-Tab-Name-and-File-Name/m-p/87127#M14251</guid>
      <dc:creator>mrthomasshelby</dc:creator>
      <dc:date>2018-09-03T09:56:04Z</dc:date>
    </item>
    <item>
      <title>Re: Macro to save file with specified Tab Name and File Name</title>
      <link>https://community.qlik.com/t5/QlikView/Macro-to-save-file-with-specified-Tab-Name-and-File-Name/m-p/87128#M14252</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Phalgun,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have a look at the attached file.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Sep 2018 10:31:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macro-to-save-file-with-specified-Tab-Name-and-File-Name/m-p/87128#M14252</guid>
      <dc:creator>tamilarasu</dc:creator>
      <dc:date>2018-09-03T10:31:14Z</dc:date>
    </item>
    <item>
      <title>Re: Macro to save file with specified Tab Name and File Name</title>
      <link>https://community.qlik.com/t5/QlikView/Macro-to-save-file-with-specified-Tab-Name-and-File-Name/m-p/87129#M14253</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Works like a dream! Thanks a lot for your time and help Tamil! Have a good day! &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Sep 2018 10:51:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macro-to-save-file-with-specified-Tab-Name-and-File-Name/m-p/87129#M14253</guid>
      <dc:creator>mrthomasshelby</dc:creator>
      <dc:date>2018-09-03T10:51:24Z</dc:date>
    </item>
    <item>
      <title>Re: Macro to save file with specified Tab Name and File Name</title>
      <link>https://community.qlik.com/t5/QlikView/Macro-to-save-file-with-specified-Tab-Name-and-File-Name/m-p/87130#M14254</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You are welcome Phalgun. Have a fantastic day!! &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Arial',sans-serif; color: #575757; background: yellow;"&gt;&lt;STRONG&gt;Update:&lt;/STRONG&gt;&lt;/SPAN&gt; I forgot to keep the cursor in Range "A1" after exporting the file. Please find the updated file.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Sep 2018 11:17:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macro-to-save-file-with-specified-Tab-Name-and-File-Name/m-p/87130#M14254</guid>
      <dc:creator>tamilarasu</dc:creator>
      <dc:date>2018-09-03T11:17:46Z</dc:date>
    </item>
    <item>
      <title>Re: Macro to save file with specified Tab Name and File Name</title>
      <link>https://community.qlik.com/t5/QlikView/Macro-to-save-file-with-specified-Tab-Name-and-File-Name/m-p/87131#M14255</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;A href="https://community.qlik.com/qlik-users/178253"&gt;tamilarasu&lt;/A&gt;‌ I have one last question. Let's say my chart is a different pivot table instead which has some columns merged. Is there any way I can modify the macro to export these columns as unmerged cells instead of merged ones? Attaching a sample for your reference. In this pivot table the first 2 columns are merged. Is there a way to export them as unmerged columns? Thank you so much again!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Sep 2018 07:38:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macro-to-save-file-with-specified-Tab-Name-and-File-Name/m-p/87131#M14255</guid>
      <dc:creator>mrthomasshelby</dc:creator>
      <dc:date>2018-09-06T07:38:20Z</dc:date>
    </item>
    <item>
      <title>Re: Macro to save file with specified Tab Name and File Name</title>
      <link>https://community.qlik.com/t5/QlikView/Macro-to-save-file-with-specified-Tab-Name-and-File-Name/m-p/87132#M14256</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Phalgun,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have a look at the updated file.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Sep 2018 12:23:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macro-to-save-file-with-specified-Tab-Name-and-File-Name/m-p/87132#M14256</guid>
      <dc:creator>tamilarasu</dc:creator>
      <dc:date>2018-09-06T12:23:21Z</dc:date>
    </item>
  </channel>
</rss>

