Hi, I am moving some data from an Access database to an Excel file with:
VB Code:
  1. oXLSheet.Range("A2").CopyFromRecordset rstExcel
I am having some troubles with the format data is displayed. With the columns that are "Date/Time"data type in the Access database I put:
VB Code:
  1. oXLSheet.Columns("A:A").NumberFormat = "dd/MM/yyyy hh:mm:ss"
in the visual basic code to move them in the correct format, and it works ok. But there are other columns that are "Number" data type in Access and when I move them to an excel file they appears like "27/02/1900"
(I think 00/00/1900 corresponds to 0). I don´t understand why the program considers this data as dates instead of numbers. I have tried:
VB Code:
  1. oXLSheet.Columns("B:B").NumberFormat = "0"
but it doesnt work. How could I get the data in the correct format? I have other columns in Access that are "Number" data type and they appear correctly in the Excel file Thank you very much for your help!!