<?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 Leading zeroes are dropped while exporting to excel using macro in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Leading-zeroes-are-dropped-while-exporting-to-excel-using-macro/m-p/856150#M658639</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am using below mentioned macro to export 2 objects to excel using a button.My data exports to excel fine, but when I look at some fields like emplid, location cd etc, the leading zeroes are dropped. Could someone please help me with this?&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sub ExcelFile&lt;BR /&gt; &lt;BR /&gt;Path = "C:\temp\"&lt;BR /&gt; FileName = "Test_" &amp;amp; GetFormattedDate&amp;nbsp; &amp;amp; ".xlsx"&lt;/P&gt;&lt;P&gt; set XLApp = CreateObject("Excel.Application")&lt;/P&gt;&lt;P&gt; XLApp.Visible = true&lt;BR /&gt; set XLDoc = XLApp.Workbooks.Add&lt;BR /&gt; &lt;BR /&gt; ActiveDocument.GetSheetObject("CH04").CopyTableToClipboard true&lt;BR /&gt; XLDoc.Sheets(1).Paste()&lt;/P&gt;&lt;P&gt; XLDoc.Sheets(1).Rows("1:3000").EntireRow.AutoFit&lt;BR /&gt; &lt;BR /&gt; &lt;BR /&gt; ActiveDocument.GetSheetObject("CH01").CopyTableToClipboard true&lt;BR /&gt; XLDoc.Sheets(2).Paste()&lt;/P&gt;&lt;P&gt; XLDoc.Sheets(2).Rows("1:3000").EntireRow.AutoFit&lt;BR /&gt; &lt;BR /&gt; 'ActiveDocument.GetSheetObject("CH24").CopyTableToClipboard true&lt;BR /&gt; 'XLDoc.Sheets(3).Paste()&lt;/P&gt;&lt;P&gt; 'XLDoc.Sheets(3).Rows("1:3000").EntireRow.AutoFit&lt;BR /&gt; &lt;BR /&gt; XLDoc.Sheets(1).Name = "Page One"&lt;BR /&gt; XLDoc.Sheets(2).Name = "Page Two"&lt;BR /&gt; 'XLDoc.Sheets(3).Name = "Page Three"&lt;BR /&gt; XLDoc.Sheets(1).Range("A1").Select&lt;BR /&gt; &lt;/P&gt;&lt;P&gt;end sub&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 13 May 2015 22:40:25 GMT</pubDate>
    <dc:creator>ektarathi</dc:creator>
    <dc:date>2015-05-13T22:40:25Z</dc:date>
    <item>
      <title>Leading zeroes are dropped while exporting to excel using macro</title>
      <link>https://community.qlik.com/t5/QlikView/Leading-zeroes-are-dropped-while-exporting-to-excel-using-macro/m-p/856150#M658639</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am using below mentioned macro to export 2 objects to excel using a button.My data exports to excel fine, but when I look at some fields like emplid, location cd etc, the leading zeroes are dropped. Could someone please help me with this?&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sub ExcelFile&lt;BR /&gt; &lt;BR /&gt;Path = "C:\temp\"&lt;BR /&gt; FileName = "Test_" &amp;amp; GetFormattedDate&amp;nbsp; &amp;amp; ".xlsx"&lt;/P&gt;&lt;P&gt; set XLApp = CreateObject("Excel.Application")&lt;/P&gt;&lt;P&gt; XLApp.Visible = true&lt;BR /&gt; set XLDoc = XLApp.Workbooks.Add&lt;BR /&gt; &lt;BR /&gt; ActiveDocument.GetSheetObject("CH04").CopyTableToClipboard true&lt;BR /&gt; XLDoc.Sheets(1).Paste()&lt;/P&gt;&lt;P&gt; XLDoc.Sheets(1).Rows("1:3000").EntireRow.AutoFit&lt;BR /&gt; &lt;BR /&gt; &lt;BR /&gt; ActiveDocument.GetSheetObject("CH01").CopyTableToClipboard true&lt;BR /&gt; XLDoc.Sheets(2).Paste()&lt;/P&gt;&lt;P&gt; XLDoc.Sheets(2).Rows("1:3000").EntireRow.AutoFit&lt;BR /&gt; &lt;BR /&gt; 'ActiveDocument.GetSheetObject("CH24").CopyTableToClipboard true&lt;BR /&gt; 'XLDoc.Sheets(3).Paste()&lt;/P&gt;&lt;P&gt; 'XLDoc.Sheets(3).Rows("1:3000").EntireRow.AutoFit&lt;BR /&gt; &lt;BR /&gt; XLDoc.Sheets(1).Name = "Page One"&lt;BR /&gt; XLDoc.Sheets(2).Name = "Page Two"&lt;BR /&gt; 'XLDoc.Sheets(3).Name = "Page Three"&lt;BR /&gt; XLDoc.Sheets(1).Range("A1").Select&lt;BR /&gt; &lt;/P&gt;&lt;P&gt;end sub&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 May 2015 22:40:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Leading-zeroes-are-dropped-while-exporting-to-excel-using-macro/m-p/856150#M658639</guid>
      <dc:creator>ektarathi</dc:creator>
      <dc:date>2015-05-13T22:40:25Z</dc:date>
    </item>
    <item>
      <title>Re: Leading zeroes are dropped while exporting to excel using macro</title>
      <link>https://community.qlik.com/t5/QlikView/Leading-zeroes-are-dropped-while-exporting-to-excel-using-macro/m-p/856151#M658640</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What if you convert your field to text by using the text() function before executing the macro? will it still export it as a text?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 May 2015 10:10:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Leading-zeroes-are-dropped-while-exporting-to-excel-using-macro/m-p/856151#M658640</guid>
      <dc:creator>Agis-Kalogiannis</dc:creator>
      <dc:date>2015-05-14T10:10:05Z</dc:date>
    </item>
    <item>
      <title>Re: Leading zeroes are dropped while exporting to excel using macro</title>
      <link>https://community.qlik.com/t5/QlikView/Leading-zeroes-are-dropped-while-exporting-to-excel-using-macro/m-p/856152#M658641</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Perhaps this discussion helps: &lt;A href="https://community.qlik.com/message/252304"&gt;Re: Export to Excel via macro-number format&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 May 2015 12:29:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Leading-zeroes-are-dropped-while-exporting-to-excel-using-macro/m-p/856152#M658641</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2015-05-14T12:29:34Z</dc:date>
    </item>
    <item>
      <title>Re: Leading zeroes are dropped while exporting to excel using macro</title>
      <link>https://community.qlik.com/t5/QlikView/Leading-zeroes-are-dropped-while-exporting-to-excel-using-macro/m-p/856153#M658642</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the reply Agis,&lt;/P&gt;&lt;P&gt;My field is already formatted to text.But it loses the format in the excel &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt; Any other suggestions?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 May 2015 16:27:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Leading-zeroes-are-dropped-while-exporting-to-excel-using-macro/m-p/856153#M658642</guid>
      <dc:creator>ektarathi</dc:creator>
      <dc:date>2015-05-14T16:27:52Z</dc:date>
    </item>
  </channel>
</rss>

