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?
Excel 2007 and using Microsoft.Office.Interop.Excel
If days are single digit, month is swapped with day when writing to Excel from a dataset.
This post has been edited by ebolisa: 16 March 2012 - 01:46 AM