Good morning everyone - I am using VB6. I need your assistance. I used the "CopyFromRecordset" function to populate my spreadsheet. Some of the fields in the access file has date values and some has number values (integers), but after importing into the spreadsheet, the numbers convert to date values(1/1/1900) and the date fields displays number values in the columns that was supposed to display dates. I have used the code below to try and fix the problem and the numbers displays correctly, but the date values are still displaying numbers (integers). My code:
Columns("A:A").Select xlApp.Selection.NumberFormat = "###" xlApp.Selection.Columns.AutoFit<==This works fine.
<==This does not work. Thanks. tgifgemini.Columns("L:L").Select <strong> xlApp.Selection.NumberFormat</strong> = "mm/dd/yyyy" xlApp.Selection.Columns.AutoFit
I have bold faced your problem. The methode of the selection object is wrong. In the earlier case it is correct as it returns the number, where as in the second case it has to be dateformat
AV Manoharan