<?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: Error exporting to excel with macro. in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Error-exporting-to-excel-with-macro/m-p/1187989#M885751</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you very much! Im so distracted! Can you answer one more&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have now this&lt;/P&gt;&lt;P&gt;( i won't write the function is too long)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sub exportToExcel_Variant1&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;aryExport(0,0) = "ResumenExporta"&lt;/P&gt;&lt;P&gt;aryExport(0,1) = "Resumen"&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;Dim objExcelWorkbook 'as Excel.Workbook&lt;/P&gt;&lt;P&gt;Set objExcelWorkbook = copyObjectsToExcelSheet(ActiveDocument, aryExport)&lt;/P&gt;&lt;P&gt;objExcelWorkbook.SaveAs "C:\Users\Jeremias\Desktop\ResumenTabla.xlsx"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;objExcelWorkbook.Application.Quit&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is working but when i put one more sheet in the excel (it works) the save doesn't working&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Excel with 2 sheets is working&lt;/P&gt;&lt;P&gt;Excel with 1 sheet and saving is working&lt;/P&gt;&lt;P&gt;Excel with 2 sheets and saving isn't working&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do you know why?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 20 Sep 2016 15:49:06 GMT</pubDate>
    <dc:creator />
    <dc:date>2016-09-20T15:49:06Z</dc:date>
    <item>
      <title>Error exporting to excel with macro.</title>
      <link>https://community.qlik.com/t5/QlikView/Error-exporting-to-excel-with-macro/m-p/1187986#M885746</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'm trying to use this macro to export different objects to excel, even using the simplest one it doesn't work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I used this in the past and i don't understand why now it isn't working&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.qlikblog.at/971/qliktip-32-exporting-multiple-objects-single-excel-document/" title="http://www.qlikblog.at/971/qliktip-32-exporting-multiple-objects-single-excel-document/" target="_blank"&gt;http://www.qlikblog.at/971/qliktip-32-exporting-multiple-objects-single-excel-document/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sub exportToExcel_Variant1&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;aryExport(0,0) = "objSalesPerYearAndRegion"&lt;/P&gt;&lt;P&gt;aryExport(0,1) = "Sales per Region a. Year"&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;Dim objExcelWorkbook 'as Excel.Workbook&lt;/P&gt;&lt;P&gt;Set objExcelWorkbook = copyObjectsToExcelSheet(ActiveDocument, aryExport)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;end sub&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if i try with msgbox("!") i have an error before this&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;STRONG&gt;Set objExcelWorkbook = copyObjectsToExcelSheet(ActiveDocument, aryExport)&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;i don't understand why because i'm not modifying the document.Im trying the original one.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers!&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Error-exporting-to-excel-with-macro/m-p/1187986#M885746</guid>
      <dc:creator />
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: Error exporting to excel with macro.</title>
      <link>https://community.qlik.com/t5/QlikView/Error-exporting-to-excel-with-macro/m-p/1187987#M885749</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi try this:&lt;/P&gt;&lt;P&gt;sub Excel_Export_ll&lt;/P&gt;&lt;P&gt;set Obj_Exl=CreateObject("Excel.Application") &lt;/P&gt;&lt;P&gt;&amp;nbsp; Obj_Exl.visible=True &lt;/P&gt;&lt;P&gt;&amp;nbsp; Obj_Exl.Workbooks.Add&lt;/P&gt;&lt;P&gt;aSheetObj=Array("CH23","CH26")&lt;/P&gt;&lt;P&gt;for i=0 to UBound(aSheetObj)&lt;/P&gt;&lt;P&gt;&amp;nbsp; Obj_Exl.Sheets.Add&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt; Set v_sheet = Obj_Exl.ActiveSheet&lt;/P&gt;&lt;P&gt;&amp;nbsp; v_sheet.Range("A1").Select&lt;/P&gt;&lt;P&gt; Set obj = ActiveDocument.GetSheetObject(aSheetObj(i))&lt;/P&gt;&lt;P&gt; obj.CopyTableToClipboard True&lt;/P&gt;&lt;P&gt;&amp;nbsp; v_sheet.Paste &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt; sCaption=obj.GetCaption.Name.v&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; set obj=Nothing&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp; v_sheet.Rows("1:1").Select&lt;/P&gt;&lt;P&gt;&amp;nbsp; Obj_Exl.Selection.Font.Bold = True&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp; v_sheet.Cells.Select&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Obj_Exl.Selection.Columns.AutoFit &lt;/P&gt;&lt;P&gt;&amp;nbsp; v_sheet.Range("A1").Select&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp; v_sheet.Name=left(sCaption,30)&lt;/P&gt;&lt;P&gt;&amp;nbsp; v_sheet.tab.color=15773696&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt; set oSH=Nothing&amp;nbsp; &lt;/P&gt;&lt;P&gt;next&lt;/P&gt;&lt;P&gt;set oXL=Nothing&lt;/P&gt;&lt;P&gt;end sub&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Sep 2016 19:44:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Error-exporting-to-excel-with-macro/m-p/1187987#M885749</guid>
      <dc:creator>el_aprendiz111</dc:creator>
      <dc:date>2016-09-19T19:44:22Z</dc:date>
    </item>
    <item>
      <title>Re: Error exporting to excel with macro.</title>
      <link>https://community.qlik.com/t5/QlikView/Error-exporting-to-excel-with-macro/m-p/1187988#M885750</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jeremias,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;STRONG&gt;copyObjectsToExcelSheet &lt;/STRONG&gt;&lt;/SPAN&gt;is a function. You copied only part of the code from original file. If you scroll down the macro window in the original file, you can see the below function code. I would suggest you to read the blog post fully. &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;A href="http://www.qlikblog.at/971/qliktip-32-exporting-multiple-objects-single-excel-document/" title="http://www.qlikblog.at/971/qliktip-32-exporting-multiple-objects-single-excel-document/"&gt;QlikTip #32: Exporting multiple QV objects to a single Excel document&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="137958" alt="Capture.PNG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/137958_Capture.PNG" style="height: 382px; width: 620px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Sep 2016 03:09:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Error-exporting-to-excel-with-macro/m-p/1187988#M885750</guid>
      <dc:creator>tamilarasu</dc:creator>
      <dc:date>2016-09-20T03:09:20Z</dc:date>
    </item>
    <item>
      <title>Re: Error exporting to excel with macro.</title>
      <link>https://community.qlik.com/t5/QlikView/Error-exporting-to-excel-with-macro/m-p/1187989#M885751</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you very much! Im so distracted! Can you answer one more&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have now this&lt;/P&gt;&lt;P&gt;( i won't write the function is too long)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sub exportToExcel_Variant1&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;aryExport(0,0) = "ResumenExporta"&lt;/P&gt;&lt;P&gt;aryExport(0,1) = "Resumen"&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;Dim objExcelWorkbook 'as Excel.Workbook&lt;/P&gt;&lt;P&gt;Set objExcelWorkbook = copyObjectsToExcelSheet(ActiveDocument, aryExport)&lt;/P&gt;&lt;P&gt;objExcelWorkbook.SaveAs "C:\Users\Jeremias\Desktop\ResumenTabla.xlsx"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;objExcelWorkbook.Application.Quit&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is working but when i put one more sheet in the excel (it works) the save doesn't working&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Excel with 2 sheets is working&lt;/P&gt;&lt;P&gt;Excel with 1 sheet and saving is working&lt;/P&gt;&lt;P&gt;Excel with 2 sheets and saving isn't working&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do you know why?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Sep 2016 15:49:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Error-exporting-to-excel-with-macro/m-p/1187989#M885751</guid>
      <dc:creator />
      <dc:date>2016-09-20T15:49:06Z</dc:date>
    </item>
    <item>
      <title>Re: Error exporting to excel with macro.</title>
      <link>https://community.qlik.com/t5/QlikView/Error-exporting-to-excel-with-macro/m-p/1187990#M885752</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Jeremias,&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;
&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;I have now this&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;( i won't write the function is too long)&lt;/P&gt;


&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&amp;nbsp; The scope of the blog was to demonstrate, how to export one object, export of three objects to three different sheets and export of multiple objects in different formats. To accomplish all the three tasks, the above function is necessary.Otherwise, you will have to write a export code for each and every task, which will be a too long code again. &lt;SPAN style="font-family: Arial;"&gt;A&lt;/SPAN&gt;&lt;SPAN style="font-family: Arial;"&gt;bove&lt;/SPAN&gt; &lt;SPAN style="font-family: Arial;"&gt;is&lt;/SPAN&gt; &lt;SPAN style="font-family: Arial;"&gt;one generic template for all the three scenarios. Of course, you can write a small code for single task. It depends on the requirement.&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: 'Segoe UI'; font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;
&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;This is working but when i put one more sheet in the excel (it works) the save doesn't working&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Excel with 2 sheets is working&lt;/P&gt;
&lt;P&gt;Excel with 1 sheet and saving is working&lt;/P&gt;
&lt;P&gt;Excel with 2 sheets and saving isn't working&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Do you know why?&lt;/P&gt;


&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Sorry, I don't understand what you are tring to acheive. Do you want to overwrite an existing excel file.? if so, you need a different code. If you could share some sample file and explain the problem, it would be easy for me to help you further. &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Sep 2016 02:25:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Error-exporting-to-excel-with-macro/m-p/1187990#M885752</guid>
      <dc:creator>tamilarasu</dc:creator>
      <dc:date>2016-09-21T02:25:17Z</dc:date>
    </item>
    <item>
      <title>Re: Error exporting to excel with macro.</title>
      <link>https://community.qlik.com/t5/QlikView/Error-exporting-to-excel-with-macro/m-p/1187991#M885753</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have tested all the threee cases and it's working fine. I have attached a sample working file for your understanding. You have to change the path to test the file in your environment.&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="138111" alt="Capture.PNG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/138111_Capture.PNG" style="font-size: 10pt; height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;In the below screen shot, you can see all the three files are saved in the mentioned folder.&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="138112" alt="Capture.PNG" class="jive-image image-2" src="https://community.qlik.com/legacyfs/online/138112_Capture.PNG" style="height: 122px; width: 620px;" /&gt;&lt;/P&gt;&lt;P&gt;If this is not what you want, please explain more about the issue.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Sep 2016 03:11:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Error-exporting-to-excel-with-macro/m-p/1187991#M885753</guid>
      <dc:creator>tamilarasu</dc:creator>
      <dc:date>2016-09-21T03:11:24Z</dc:date>
    </item>
  </channel>
</rss>

