<?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 Create year folder to export data in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Create-year-folder-to-export-data/m-p/1794005#M1210983</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I need to export to Pivot tables and a Line chart to an excel file. I have used the below code. In this case, it&amp;nbsp; saves directly to \\Desktop\TLM\QlikView_TLM_Output\. But I also want it to creat the current Year and Month and then save the file&lt;/P&gt;&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;For eg: It saves in \\Desktop\TLM\QlikView_TLM_Output\2021\March wherein the year (2021) and month(March) is created dynamically so that it changes with change in year and month&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;&lt;P&gt;sub Export&lt;/P&gt;&lt;P&gt;Path = "\\Desktop\TLM\QlikView_TLM_Output\"&lt;/P&gt;&lt;P&gt;FileName = "TLM-CCY's Daily metrics_" &amp;amp; ActiveDocument.Evaluate("Date(Now(), 'DD-MM-YYYY hhmmss')") &amp;amp; ".xlsx"&lt;/P&gt;&lt;P&gt;'Create the Excel spreadsheet&lt;BR /&gt;Set XLApp = CreateObject("Excel.Application")&lt;BR /&gt;XLApp.Visible = False&lt;BR /&gt;'Create the WorkBook&lt;BR /&gt;Set XLDoc = XLApp.WorkBooks.Add&lt;BR /&gt;'Create the Sheet&lt;BR /&gt;Set XLSheet = XLDoc.WorkSheets(1)&lt;BR /&gt;&lt;BR /&gt;'Get the chart we want to export&lt;BR /&gt;Set tableToExport = ActiveDocument.GetSheetObject("Break Volume")&lt;BR /&gt;Set chartProperties = tableToExport.GetProperties&lt;BR /&gt;tableToExport.CopyTableToClipboard true&lt;BR /&gt;&lt;BR /&gt;'Get the caption&lt;BR /&gt;chartCaption = tableToExport.GetCaption.Name.v&lt;BR /&gt;'MsgBox chartCaption&lt;BR /&gt;&lt;BR /&gt;'Set the first cell with the caption&lt;BR /&gt;XLSheet.Range("A1") = chartCaption&lt;BR /&gt;'Paste the rest of the chart&lt;BR /&gt;XLSheet.Paste XLSheet.Range("A2")&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;'Get the chart we want to export&lt;BR /&gt;Set tableToExport = ActiveDocument.GetSheetObject("Break Scenerio")&lt;BR /&gt;Set chartProperties = tableToExport.GetProperties&lt;BR /&gt;tableToExport.CopyTableToClipboard true&lt;BR /&gt;&lt;BR /&gt;'Get the caption&lt;BR /&gt;chartCaption = tableToExport.GetCaption.Name.v&lt;BR /&gt;'MsgBox chartCaption&lt;BR /&gt;&lt;BR /&gt;'Set the first cell with the caption&lt;BR /&gt;XLSheet.Range("J1") = chartCaption&lt;BR /&gt;'Paste the rest of the chart&lt;BR /&gt;XLSheet.Paste XLSheet.Range("J2")&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;'Get the chart we want to export&lt;BR /&gt;Set tableToExport = ActiveDocument.GetSheetObject("Trend Analysis")&lt;BR /&gt;Set chartProperties = tableToExport.GetProperties&lt;BR /&gt;tableToExport.CopyBitmapToClipboard()&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;'Get the caption&lt;BR /&gt;chartCaption = tableToExport.GetCaption.Name.v&lt;BR /&gt;'MsgBox chartCaption&lt;BR /&gt;&lt;BR /&gt;'Set the first cell with the caption&lt;BR /&gt;XLSheet.Range("J15") = chartCaption&lt;BR /&gt;'Paste the rest of the chart&lt;BR /&gt;XLSheet.Paste XLSheet.Range("J16")&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Set XLSheet = XLDoc.WorkSheets(2)&lt;BR /&gt;'WorkSheets(2).Name = "RawData"&lt;BR /&gt;'Get the chart we want to export&lt;BR /&gt;Set tableToExport = ActiveDocument.GetSheetObject("Raw Data")&lt;BR /&gt;Set chartProperties = tableToExport.GetProperties&lt;BR /&gt;tableToExport.CopyTABLEToClipboard TRUE&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;'Get the caption&lt;BR /&gt;chartCaption = tableToExport.GetCaption.Name.v&lt;BR /&gt;'MsgBox chartCaption&lt;BR /&gt;&lt;BR /&gt;'Set the first cell with the caption&lt;BR /&gt;XLSheet.Range("A1") = chartCaption&lt;BR /&gt;'Paste the rest of the chart&lt;BR /&gt;XLSheet.Paste XLSheet.Range("A2")&lt;BR /&gt;&lt;BR /&gt;'Save the file and quit excel&lt;BR /&gt;XLDoc.SaveAs Path &amp;amp; FileName&lt;BR /&gt;&lt;BR /&gt;XLDoc.Close&lt;BR /&gt;XLApp.Quit&lt;BR /&gt;&lt;BR /&gt;Msgbox "File exported successfully!!"&lt;BR /&gt;'Cleanup&lt;BR /&gt;&lt;BR /&gt;Set XLDoc = nothing&lt;BR /&gt;Set XLApp = nothing&lt;BR /&gt;End Sub&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 24 Mar 2021 10:08:10 GMT</pubDate>
    <dc:creator>arpita</dc:creator>
    <dc:date>2021-03-24T10:08:10Z</dc:date>
    <item>
      <title>Create year folder to export data</title>
      <link>https://community.qlik.com/t5/QlikView/Create-year-folder-to-export-data/m-p/1794005#M1210983</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I need to export to Pivot tables and a Line chart to an excel file. I have used the below code. In this case, it&amp;nbsp; saves directly to \\Desktop\TLM\QlikView_TLM_Output\. But I also want it to creat the current Year and Month and then save the file&lt;/P&gt;&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;For eg: It saves in \\Desktop\TLM\QlikView_TLM_Output\2021\March wherein the year (2021) and month(March) is created dynamically so that it changes with change in year and month&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;&lt;P&gt;sub Export&lt;/P&gt;&lt;P&gt;Path = "\\Desktop\TLM\QlikView_TLM_Output\"&lt;/P&gt;&lt;P&gt;FileName = "TLM-CCY's Daily metrics_" &amp;amp; ActiveDocument.Evaluate("Date(Now(), 'DD-MM-YYYY hhmmss')") &amp;amp; ".xlsx"&lt;/P&gt;&lt;P&gt;'Create the Excel spreadsheet&lt;BR /&gt;Set XLApp = CreateObject("Excel.Application")&lt;BR /&gt;XLApp.Visible = False&lt;BR /&gt;'Create the WorkBook&lt;BR /&gt;Set XLDoc = XLApp.WorkBooks.Add&lt;BR /&gt;'Create the Sheet&lt;BR /&gt;Set XLSheet = XLDoc.WorkSheets(1)&lt;BR /&gt;&lt;BR /&gt;'Get the chart we want to export&lt;BR /&gt;Set tableToExport = ActiveDocument.GetSheetObject("Break Volume")&lt;BR /&gt;Set chartProperties = tableToExport.GetProperties&lt;BR /&gt;tableToExport.CopyTableToClipboard true&lt;BR /&gt;&lt;BR /&gt;'Get the caption&lt;BR /&gt;chartCaption = tableToExport.GetCaption.Name.v&lt;BR /&gt;'MsgBox chartCaption&lt;BR /&gt;&lt;BR /&gt;'Set the first cell with the caption&lt;BR /&gt;XLSheet.Range("A1") = chartCaption&lt;BR /&gt;'Paste the rest of the chart&lt;BR /&gt;XLSheet.Paste XLSheet.Range("A2")&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;'Get the chart we want to export&lt;BR /&gt;Set tableToExport = ActiveDocument.GetSheetObject("Break Scenerio")&lt;BR /&gt;Set chartProperties = tableToExport.GetProperties&lt;BR /&gt;tableToExport.CopyTableToClipboard true&lt;BR /&gt;&lt;BR /&gt;'Get the caption&lt;BR /&gt;chartCaption = tableToExport.GetCaption.Name.v&lt;BR /&gt;'MsgBox chartCaption&lt;BR /&gt;&lt;BR /&gt;'Set the first cell with the caption&lt;BR /&gt;XLSheet.Range("J1") = chartCaption&lt;BR /&gt;'Paste the rest of the chart&lt;BR /&gt;XLSheet.Paste XLSheet.Range("J2")&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;'Get the chart we want to export&lt;BR /&gt;Set tableToExport = ActiveDocument.GetSheetObject("Trend Analysis")&lt;BR /&gt;Set chartProperties = tableToExport.GetProperties&lt;BR /&gt;tableToExport.CopyBitmapToClipboard()&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;'Get the caption&lt;BR /&gt;chartCaption = tableToExport.GetCaption.Name.v&lt;BR /&gt;'MsgBox chartCaption&lt;BR /&gt;&lt;BR /&gt;'Set the first cell with the caption&lt;BR /&gt;XLSheet.Range("J15") = chartCaption&lt;BR /&gt;'Paste the rest of the chart&lt;BR /&gt;XLSheet.Paste XLSheet.Range("J16")&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Set XLSheet = XLDoc.WorkSheets(2)&lt;BR /&gt;'WorkSheets(2).Name = "RawData"&lt;BR /&gt;'Get the chart we want to export&lt;BR /&gt;Set tableToExport = ActiveDocument.GetSheetObject("Raw Data")&lt;BR /&gt;Set chartProperties = tableToExport.GetProperties&lt;BR /&gt;tableToExport.CopyTABLEToClipboard TRUE&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;'Get the caption&lt;BR /&gt;chartCaption = tableToExport.GetCaption.Name.v&lt;BR /&gt;'MsgBox chartCaption&lt;BR /&gt;&lt;BR /&gt;'Set the first cell with the caption&lt;BR /&gt;XLSheet.Range("A1") = chartCaption&lt;BR /&gt;'Paste the rest of the chart&lt;BR /&gt;XLSheet.Paste XLSheet.Range("A2")&lt;BR /&gt;&lt;BR /&gt;'Save the file and quit excel&lt;BR /&gt;XLDoc.SaveAs Path &amp;amp; FileName&lt;BR /&gt;&lt;BR /&gt;XLDoc.Close&lt;BR /&gt;XLApp.Quit&lt;BR /&gt;&lt;BR /&gt;Msgbox "File exported successfully!!"&lt;BR /&gt;'Cleanup&lt;BR /&gt;&lt;BR /&gt;Set XLDoc = nothing&lt;BR /&gt;Set XLApp = nothing&lt;BR /&gt;End Sub&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Mar 2021 10:08:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Create-year-folder-to-export-data/m-p/1794005#M1210983</guid>
      <dc:creator>arpita</dc:creator>
      <dc:date>2021-03-24T10:08:10Z</dc:date>
    </item>
    <item>
      <title>Re: Create year folder to export data</title>
      <link>https://community.qlik.com/t5/QlikView/Create-year-folder-to-export-data/m-p/1794225#M1211001</link>
      <description>&lt;P&gt;Perhaps something along the lines of this formula would work? I don't work with macros much, so the syntax may not be perfect, but assuming the one you posted works I think should too...&lt;/P&gt;&lt;P&gt;Path = "\\Desktop\TLM\QlikView_TLM_Output\" &amp;amp; ActiveDocument.Evaluate("Year(Now())") &amp;amp; "\" &amp;amp; ActiveDocument.Evaluate("Month(Now())")&lt;/P&gt;</description>
      <pubDate>Wed, 24 Mar 2021 20:44:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Create-year-folder-to-export-data/m-p/1794225#M1211001</guid>
      <dc:creator>Or</dc:creator>
      <dc:date>2021-03-24T20:44:05Z</dc:date>
    </item>
    <item>
      <title>Re: Create year folder to export data</title>
      <link>https://community.qlik.com/t5/QlikView/Create-year-folder-to-export-data/m-p/1794330#M1211006</link>
      <description>&lt;P&gt;This doesnt work&lt;/P&gt;</description>
      <pubDate>Thu, 25 Mar 2021 08:23:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Create-year-folder-to-export-data/m-p/1794330#M1211006</guid>
      <dc:creator>arpita</dc:creator>
      <dc:date>2021-03-25T08:23:13Z</dc:date>
    </item>
  </channel>
</rss>

