<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Codelab Blog &#187; Excel</title>
	<atom:link href="http://blog.codelab.co.nz/tag/excel/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.codelab.co.nz</link>
	<description>Technical Articles and News from Codelab Ltd</description>
	<lastBuildDate>Tue, 17 Jan 2012 13:10:43 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Open XML &#8211; OLE Automation Date Issues</title>
		<link>http://blog.codelab.co.nz/2010/07/26/open-xml-ole-automation-date-issues/</link>
		<comments>http://blog.codelab.co.nz/2010/07/26/open-xml-ole-automation-date-issues/#comments</comments>
		<pubDate>Sun, 25 Jul 2010 12:16:20 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
				<category><![CDATA[.NET Framework]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[.NET]]></category>
		<category><![CDATA[Excel]]></category>

		<guid isPermaLink="false">http://blog.codelab.co.nz/?p=290</guid>
		<description><![CDATA[If you are exporting a date from C# to Excel using 2007, you probably will use the following: Math.Round(DateTime.Now.ToOADate(), 12).ToString() This exports the date as a OLE Automation date recognized by Excel 2007. How ever, in Excel 2010 this was causing issues, every time I exported to Excel 2010, it said that it has to [...]]]></description>
			<content:encoded><![CDATA[<p>If you are exporting a date from C# to Excel using 2007, you probably will use the following:</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">Math.Round(DateTime.Now.ToOADate(), 12).ToString()</div></div>
<p>This exports the date as a OLE Automation date recognized by Excel 2007.   How ever, in Excel 2010 this was causing issues, every time I exported to Excel 2010, it said that it has to repair my document and it never displayed the values correctly as dates.</p>
<p>Because I was using Open XML to generate the markup, Excel 2010 has been support for Open XML.   I got around the problem of using:</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">DateTime.Now.ToString(&quot;yyyy-MM-dd'T'HH:mm:ss.fffffffzzz&quot;);</div></div>
<p>This exports the date as a XML Date format.<br />
Hope this helps anyone who has the same problem!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.codelab.co.nz/2010/07/26/open-xml-ole-automation-date-issues/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

