<?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 export table to excel in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Macro-to-export-table-to-excel/m-p/608612#M1117328</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a question about this macro.&lt;/P&gt;&lt;P&gt;I've imported this code in my dashboard.&lt;/P&gt;&lt;P&gt;I've implemented it that if I reload my dashboard at the end he wil generate the excel in a folder.&lt;/P&gt;&lt;P&gt;If I reload my dashboard on my laptop it is working fine.&lt;/P&gt;&lt;P&gt;But if I do it on the server it isn't working.&lt;/P&gt;&lt;P&gt;I think I have to install Excel on the server.&lt;/P&gt;&lt;P&gt;But is it working if I schedule the job in the management-console after I installed Excel on the server?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Kris&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 26 Nov 2014 11:22:59 GMT</pubDate>
    <dc:creator>kris_vliegen</dc:creator>
    <dc:date>2014-11-26T11:22:59Z</dc:date>
    <item>
      <title>Macro to export table to excel</title>
      <link>https://community.qlik.com/t5/QlikView/Macro-to-export-table-to-excel/m-p/608609#M1117325</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi community,&lt;/P&gt;&lt;P&gt;I have a macro to export a table to excel.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sub test&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;'Set the path where the excel will be saved&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; filePath = "C:\Test.xls"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'Create the Excel spreadsheet&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set excelFile = CreateObject("Excel.Application")&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; excelFile.Visible = true&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'Create the WorkBook&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set curWorkBook = excelFile.WorkBooks.Add&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'Create the Sheet&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'first chart object&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set curSheet = curWorkBook.WorkSheets(1)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;'loop&lt;/P&gt;&lt;P&gt;chartArray = Array("CH02") ' give the name of your object instead of CH06&lt;/P&gt;&lt;P&gt;usedRows=0&lt;/P&gt;&lt;P&gt;For Each chart In chartArray&lt;/P&gt;&lt;P&gt;&amp;nbsp; Set i = ActiveDocument.GetSheetObject(chart)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; chartCaption = i.GetCaption.Name.v&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; curSheet.Cells(usedRows+1, 1)=chartCaption&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; i.CopyTableToClipboard true&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; curSheet.Cells(usedRows+3, 1).Select&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; curSheet.Paste&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; usedRows=curSheet.UsedRange.Rows.Count+3 &lt;/P&gt;&lt;P&gt;Next&lt;/P&gt;&lt;P&gt;'loop end&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;excelFile.Visible = true&lt;/P&gt;&lt;P&gt;'Save the file and quit excel&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; curWorkBook.SaveAs filePath&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; curWorkBook.Close&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; excelFile.Quit&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'Cleanup&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set curWorkBook = nothing&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set excelFile = nothing&lt;/P&gt;&lt;P&gt;end sub&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;when I run my test macro, it works well, but it opens module mode at the end.&lt;/P&gt;&lt;P&gt;Why?&amp;nbsp; How can I fix it?&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Feb 2014 16:10:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macro-to-export-table-to-excel/m-p/608609#M1117325</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-02-19T16:10:10Z</dc:date>
    </item>
    <item>
      <title>Re: Macro to export table to excel</title>
      <link>https://community.qlik.com/t5/QlikView/Macro-to-export-table-to-excel/m-p/608610#M1117326</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It means that there's something wrong with macro. My guess is that you might be trying to export a chart that doesn't exist.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Feb 2014 20:34:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macro-to-export-table-to-excel/m-p/608610#M1117326</guid>
      <dc:creator>jerem1234</dc:creator>
      <dc:date>2014-02-19T20:34:44Z</dc:date>
    </item>
    <item>
      <title>Re: Macro to export table to excel</title>
      <link>https://community.qlik.com/t5/QlikView/Macro-to-export-table-to-excel/m-p/608611#M1117327</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks my friend.&lt;/P&gt;&lt;P&gt;I fixed&amp;nbsp; it . &lt;/P&gt;&lt;P&gt;I commented path and it works.&lt;/P&gt;&lt;P&gt;I marked as answered. It should be a couple comments early.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Feb 2014 20:39:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macro-to-export-table-to-excel/m-p/608611#M1117327</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-02-19T20:39:01Z</dc:date>
    </item>
    <item>
      <title>Re: Macro to export table to excel</title>
      <link>https://community.qlik.com/t5/QlikView/Macro-to-export-table-to-excel/m-p/608612#M1117328</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a question about this macro.&lt;/P&gt;&lt;P&gt;I've imported this code in my dashboard.&lt;/P&gt;&lt;P&gt;I've implemented it that if I reload my dashboard at the end he wil generate the excel in a folder.&lt;/P&gt;&lt;P&gt;If I reload my dashboard on my laptop it is working fine.&lt;/P&gt;&lt;P&gt;But if I do it on the server it isn't working.&lt;/P&gt;&lt;P&gt;I think I have to install Excel on the server.&lt;/P&gt;&lt;P&gt;But is it working if I schedule the job in the management-console after I installed Excel on the server?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Kris&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Nov 2014 11:22:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macro-to-export-table-to-excel/m-p/608612#M1117328</guid>
      <dc:creator>kris_vliegen</dc:creator>
      <dc:date>2014-11-26T11:22:59Z</dc:date>
    </item>
  </channel>
</rss>

