<?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 Keeping leading zero when exporting to Excel using Macro in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Keeping-leading-zero-when-exporting-to-Excel-using-Macro/m-p/1205143#M626910</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello QlikView Community,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a macro that creates an Excel file with&amp;nbsp; multiple tabs and with it different data sets in each tab.&amp;nbsp; For each tab, there is a column (column L titled AuthId) that has an 9-digit ID number (includes leading zero).&amp;nbsp; In my data, this leading zero is definitely recognized by QlikView (I see the leading zero when I view that field--see picture below).&amp;nbsp; However, this leading zero is dropped when the macro exports the data to the Excel file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What can I add to my macro script to keep or even add a leading zero to this field?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What it should look like:&lt;/P&gt;&lt;P&gt;&lt;IMG border="0" class="jive-image image-1" height="129" src="https://community.qlik.com/legacyfs/online/142707_pastedImage_1.png" style="max-height: 900px; max-width: 1200px;" width="179" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is my macro script for this file:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff6600;"&gt;sub exportToExcel_Variant6&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #ff6600;"&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #ff6600;"&gt; '// Array for export definitions&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #ff6600;"&gt; Dim aryExport(2,3)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #ff6600;"&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #ff6600;"&gt; aryExport(0,0) = "objPended" &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #ff6600;"&gt; aryExport(0,1) = "Pending" &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #ff6600;"&gt; aryExport(0,2) = "A1"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #ff6600;"&gt; aryExport(0,3) = "data"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #ff6600;"&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #ff6600;"&gt; aryExport(1,0) = "objApproved" &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #ff6600;"&gt; aryExport(1,1) = "Approved" &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #ff6600;"&gt; aryExport(1,2) = "A1"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #ff6600;"&gt; aryExport(1,3) = "data"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #ff6600;"&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #ff6600;"&gt; Dim objExcelWorkbook 'as Excel.Workbook&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #ff6600;"&gt; Set objExcelWorkbook = copyObjectsToExcelSheet(ActiveDocument, aryExport)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #ff6600;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff6600;"&gt;end sub&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you in advance for any help.&amp;nbsp; Please let me know what other information I can provide to help resolve this.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 02 Nov 2016 15:25:22 GMT</pubDate>
    <dc:creator />
    <dc:date>2016-11-02T15:25:22Z</dc:date>
    <item>
      <title>Keeping leading zero when exporting to Excel using Macro</title>
      <link>https://community.qlik.com/t5/QlikView/Keeping-leading-zero-when-exporting-to-Excel-using-Macro/m-p/1205143#M626910</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello QlikView Community,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a macro that creates an Excel file with&amp;nbsp; multiple tabs and with it different data sets in each tab.&amp;nbsp; For each tab, there is a column (column L titled AuthId) that has an 9-digit ID number (includes leading zero).&amp;nbsp; In my data, this leading zero is definitely recognized by QlikView (I see the leading zero when I view that field--see picture below).&amp;nbsp; However, this leading zero is dropped when the macro exports the data to the Excel file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What can I add to my macro script to keep or even add a leading zero to this field?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What it should look like:&lt;/P&gt;&lt;P&gt;&lt;IMG border="0" class="jive-image image-1" height="129" src="https://community.qlik.com/legacyfs/online/142707_pastedImage_1.png" style="max-height: 900px; max-width: 1200px;" width="179" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is my macro script for this file:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff6600;"&gt;sub exportToExcel_Variant6&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #ff6600;"&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #ff6600;"&gt; '// Array for export definitions&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #ff6600;"&gt; Dim aryExport(2,3)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #ff6600;"&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #ff6600;"&gt; aryExport(0,0) = "objPended" &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #ff6600;"&gt; aryExport(0,1) = "Pending" &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #ff6600;"&gt; aryExport(0,2) = "A1"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #ff6600;"&gt; aryExport(0,3) = "data"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #ff6600;"&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #ff6600;"&gt; aryExport(1,0) = "objApproved" &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #ff6600;"&gt; aryExport(1,1) = "Approved" &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #ff6600;"&gt; aryExport(1,2) = "A1"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #ff6600;"&gt; aryExport(1,3) = "data"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #ff6600;"&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #ff6600;"&gt; Dim objExcelWorkbook 'as Excel.Workbook&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #ff6600;"&gt; Set objExcelWorkbook = copyObjectsToExcelSheet(ActiveDocument, aryExport)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #ff6600;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff6600;"&gt;end sub&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you in advance for any help.&amp;nbsp; Please let me know what other information I can provide to help resolve this.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Nov 2016 15:25:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Keeping-leading-zero-when-exporting-to-Excel-using-Macro/m-p/1205143#M626910</guid>
      <dc:creator />
      <dc:date>2016-11-02T15:25:22Z</dc:date>
    </item>
  </channel>
</rss>

