<?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: Export to excel changes the format from text to date in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Export-to-excel-changes-the-format-from-text-to-date/m-p/1612802#M736861</link>
    <description>&lt;P&gt;Unfortunately it doesn't work for xlsx files.&lt;/P&gt;</description>
    <pubDate>Thu, 15 Aug 2019 10:46:01 GMT</pubDate>
    <dc:creator>Guidok</dc:creator>
    <dc:date>2019-08-15T10:46:01Z</dc:date>
    <item>
      <title>Export to excel changes the format from text to date</title>
      <link>https://community.qlik.com/t5/QlikView/Export-to-excel-changes-the-format-from-text-to-date/m-p/1608016#M736859</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I've added a export button for exporting some of the tables to excel. This works fine, but we have locations that look like a date.&amp;nbsp; For example 22-01-50&lt;/P&gt;&lt;P&gt;In Qlikview this location is 22-01-50 but when exported to excel it looks like 22-1-1950.&lt;/P&gt;&lt;P&gt;We have a lot of formats for locations but the length has a maximum of 10 characters.&lt;/P&gt;&lt;P&gt;I've added some VB code to prevent this, but it doesn't work. I've seached the forum and used google, but I couldn't find a script that does the trick (I'm a VB newbie).&lt;/P&gt;&lt;P&gt;This is what I have now:&lt;/P&gt;&lt;P&gt;sub Aanvullen&lt;BR /&gt;Set objExcel = CreateObject("Excel.Application")&lt;BR /&gt;objExcel.Visible = False&lt;BR /&gt;objExcel.DisplayAlerts = False&lt;BR /&gt;Set xlDoc = objExcel.Workbooks.Add&lt;BR /&gt;set obj = ActiveDocument.GetSheetObject("CH02")&lt;BR /&gt;obj.CopyTableToClipboard true&lt;BR /&gt;objExcel.Worksheets(1).Columns("A:C").Numberformat = "@@@@@@@@@@"&lt;BR /&gt;objExcel.Range("A1").PasteSpecial&lt;BR /&gt;objExcel.Worksheets(1).Rows("1:1000").RowHeight = 15&lt;BR /&gt;objExcel.Worksheets(1).Columns("A:C").Autofit&lt;BR /&gt;xlDoc.SaveAs "X:\Uitwissel\Logistieke Controles\Aanvullen.xlsx"&lt;BR /&gt;xlDoc.Close&lt;BR /&gt;end sub&lt;/P&gt;</description>
      <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Export-to-excel-changes-the-format-from-text-to-date/m-p/1608016#M736859</guid>
      <dc:creator>Guidok</dc:creator>
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: Export to excel changes the format from text to date</title>
      <link>https://community.qlik.com/t5/QlikView/Export-to-excel-changes-the-format-from-text-to-date/m-p/1609673#M736860</link>
      <description>&lt;P&gt;This is because by the time you have pasted down the data, Excel has already internally changed the data to a date.&amp;nbsp; No formatting can change that as internally, that field is now the serial equivalent of that date.&amp;nbsp; So the fix has to be in the way we get the data out.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;set obj = ActiveDocument.GetSheetObject("&lt;SPAN&gt;CH02&lt;/SPAN&gt;")&lt;/P&gt;&lt;P&gt;obj.ExportBiff "&lt;SPAN&gt;X:\Uitwissel\Logistieke Controles\&lt;/SPAN&gt;&lt;SPAN&gt;Aanvullen&lt;/SPAN&gt;.xls"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This will fix the issue, but it will export as xls.&amp;nbsp; You may be able to export to xlsx in the latest version, but I can't test that.&lt;/P&gt;</description>
      <pubDate>Tue, 06 Aug 2019 08:46:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Export-to-excel-changes-the-format-from-text-to-date/m-p/1609673#M736860</guid>
      <dc:creator>MarkWillems</dc:creator>
      <dc:date>2019-08-06T08:46:00Z</dc:date>
    </item>
    <item>
      <title>Re: Export to excel changes the format from text to date</title>
      <link>https://community.qlik.com/t5/QlikView/Export-to-excel-changes-the-format-from-text-to-date/m-p/1612802#M736861</link>
      <description>&lt;P&gt;Unfortunately it doesn't work for xlsx files.&lt;/P&gt;</description>
      <pubDate>Thu, 15 Aug 2019 10:46:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Export-to-excel-changes-the-format-from-text-to-date/m-p/1612802#M736861</guid>
      <dc:creator>Guidok</dc:creator>
      <dc:date>2019-08-15T10:46:01Z</dc:date>
    </item>
    <item>
      <title>Re: Export to excel changes the format from text to date</title>
      <link>https://community.qlik.com/t5/QlikView/Export-to-excel-changes-the-format-from-text-to-date/m-p/1612813#M736862</link>
      <description>&lt;P&gt;try this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;sub Aanvullen
Set objExcel = CreateObject("Excel.Application")
objExcel.Visible = False
objExcel.DisplayAlerts = False
Set xlDoc = objExcel.Workbooks.Add
set obj = ActiveDocument.GetSheetObject("CH02")
obj.CopyTableToClipboard true
objExcel.Worksheets(1).Columns("A:C").Numberformat = "@"
objExcel.Range("A1").PasteSpecial 1
objExcel.Worksheets(1).Rows("1:1000").RowHeight = 15
objExcel.Worksheets(1).Columns("A:C").Autofit
xlDoc.SaveAs "X:\Uitwissel\Logistieke Controles\Aanvullen.xlsx"
xlDoc.Close
end sub&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 15 Aug 2019 11:03:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Export-to-excel-changes-the-format-from-text-to-date/m-p/1612813#M736862</guid>
      <dc:creator>Frank_Hartmann</dc:creator>
      <dc:date>2019-08-15T11:03:30Z</dc:date>
    </item>
  </channel>
</rss>

