<?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 OLE2 Excel Date Auto-Conversion in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/ole2-excel-date-auto-conversion/m-p/422343#M11601</link>
    <description>&lt;P&gt;I am using OLE2 objects to pass some data into an excel file.&lt;/P&gt;&lt;P&gt;This includes dates specifically in the 'dd-mm-yyyy' format.&lt;/P&gt;&lt;P&gt;Now, excel understands if a date has been passed, and auto-converts the value into the date format. By default, this is dd-mm-yy.&lt;/P&gt;&lt;P&gt;So I set the NumberFormats property of the column to 'dd-mm-yyyy'. &lt;/P&gt;&lt;P&gt;----&lt;/P&gt;&lt;P&gt; CALL METHOD OF O_EXCEL&lt;BR /&gt;
 'COLUMNS' = O_COLUMN&lt;BR /&gt;
 EXPORTING&lt;BR /&gt;
 #1 = GV_COL.&lt;BR /&gt;
&lt;BR /&gt;
 SET PROPERTY OF O_COLUMN&lt;BR /&gt;
 'NUMBERFORMAT' = 'DD-MM-YYYY'. "'[$-14409]dd-mm-yyyy;@'.&lt;/P&gt;&lt;P&gt;----&lt;/P&gt;&lt;P&gt;This works, but because my excel is localized to the US, it auto-converts it to MM-DD-YYYY. But it doesn't do this consistently. &lt;/P&gt;&lt;P&gt;When I pass 04-07-2017 (4th July), I get 07-04-2017&lt;/P&gt;&lt;P&gt;But when I pass 13-12-2017 (13th Dec), I get 13-12-2017. &lt;/P&gt;&lt;P&gt;So when the date doesn't quite add up in the mm-dd format, excel doesn't auto-convert it. Passing '@' as the NumberFormats value got me a 5 digit number, and I cannot concatenate a ''' to pass it as text because the file needs to be uploaded elsewhere and a ''' in the date column may cause issues.&lt;/P&gt;&lt;P&gt;Is there a way to fix this by disabling excel auto-conversion or formatting?&lt;/P&gt;</description>
    <pubDate>Tue, 04 Jul 2017 07:34:09 GMT</pubDate>
    <dc:creator>aditya_govilkar</dc:creator>
    <dc:date>2017-07-04T07:34:09Z</dc:date>
    <item>
      <title>OLE2 Excel Date Auto-Conversion</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/ole2-excel-date-auto-conversion/m-p/422343#M11601</link>
      <description>&lt;P&gt;I am using OLE2 objects to pass some data into an excel file.&lt;/P&gt;&lt;P&gt;This includes dates specifically in the 'dd-mm-yyyy' format.&lt;/P&gt;&lt;P&gt;Now, excel understands if a date has been passed, and auto-converts the value into the date format. By default, this is dd-mm-yy.&lt;/P&gt;&lt;P&gt;So I set the NumberFormats property of the column to 'dd-mm-yyyy'. &lt;/P&gt;&lt;P&gt;----&lt;/P&gt;&lt;P&gt; CALL METHOD OF O_EXCEL&lt;BR /&gt;
 'COLUMNS' = O_COLUMN&lt;BR /&gt;
 EXPORTING&lt;BR /&gt;
 #1 = GV_COL.&lt;BR /&gt;
&lt;BR /&gt;
 SET PROPERTY OF O_COLUMN&lt;BR /&gt;
 'NUMBERFORMAT' = 'DD-MM-YYYY'. "'[$-14409]dd-mm-yyyy;@'.&lt;/P&gt;&lt;P&gt;----&lt;/P&gt;&lt;P&gt;This works, but because my excel is localized to the US, it auto-converts it to MM-DD-YYYY. But it doesn't do this consistently. &lt;/P&gt;&lt;P&gt;When I pass 04-07-2017 (4th July), I get 07-04-2017&lt;/P&gt;&lt;P&gt;But when I pass 13-12-2017 (13th Dec), I get 13-12-2017. &lt;/P&gt;&lt;P&gt;So when the date doesn't quite add up in the mm-dd format, excel doesn't auto-convert it. Passing '@' as the NumberFormats value got me a 5 digit number, and I cannot concatenate a ''' to pass it as text because the file needs to be uploaded elsewhere and a ''' in the date column may cause issues.&lt;/P&gt;&lt;P&gt;Is there a way to fix this by disabling excel auto-conversion or formatting?&lt;/P&gt;</description>
      <pubDate>Tue, 04 Jul 2017 07:34:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/ole2-excel-date-auto-conversion/m-p/422343#M11601</guid>
      <dc:creator>aditya_govilkar</dc:creator>
      <dc:date>2017-07-04T07:34:09Z</dc:date>
    </item>
  </channel>
</rss>

