Hi, I am moving some data from an Access database to an Excel file with:
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:
oXLSheet.Range("A2").CopyFromRecordset rstExcel
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"VB Code:
oXLSheet.Columns("A:A").NumberFormat = "dd/MM/yyyy hh:mm:ss"
(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:
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 fileVB Code:
oXLSheet.Columns("B:B").NumberFormat = "0"Thank you very much for your help!!


Thank you very much for your help!!
Reply With Quote
