Quantcast
Channel: Open XML Format SDK forum
Viewing all articles
Browse latest Browse all 1288

How do you add a standard format date Cell to an existing Excel Spreadsheet using OpenXML?

$
0
0

Hi,

I am trying to add a formatted date cell "m/d/yy" to an existing excel spreadsheet, but all I can get is the date number:

where "r" is new Row() and row.LeaseStartDate="yyyy-mm-dd"

r.AppendChild(new Cell() { CellReference = "D" + Convert.ToString(idx), CellValue = new CellValue(){Text = row.LeaseStartDate} ,DataType= CellValues.Date});

The correct information appears, but is is the ToOADate() number, not in dateformat. I have tried adding StyleIndex=1 with same results.

I am using Excel 2010/2013

Thank you

         

Paul



Viewing all articles
Browse latest Browse all 1288


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>