I’m exporting datagridview data to Excel via dataset.
Col 1 of my datagridview contains dates and the grid shows the dates w/o time.
Once exported the dates to Excel, they are then formatted via
wSheet.Range("B:B").NumberFormat = "ddMM"
The above code works fine for dates having a single digit day. For days 10 and above, the dates are shown as dd/MM/yyyy 00:00 in the excel sheet.
Does anyone know why this is happening?
Thank you.
Excel 2007 and using Microsoft.Office.Interop.Excel
EDIT:
If days are single digit, month is swapped with day when writing to Excel from a dataset.
Attached image(s)
This post has been edited by ebolisa: 16 March 2012 - 01:46 AM

New Topic/Question
Reply




MultiQuote





|