Imoprting text file with dates using VB code


Posted by Bob Leed on October 30, 2000 6:21 AM

When I attempt to import a tab delimited text file containing some date values into Excel 2000 using VBA code, the day and month values are switched, ie 01/07/1999 becomes 07/01/1999. I have noticed that this happens only on some PCs and I think it is related to the operating system. I have found a knowledge base article which describes a similar problem with Excel 97 - refer Q172588. I have formerly resolved the problem by upgrading to Excel 2000 but now even this produces the error.Is there some way of avoiding this?



Posted by Zif on October 30, 2000 8:55 AM

Have you checked the Regional Settings in Control Panel.

We had a similar problem at work where some PC's were set to UK date format (dd/mm/yyyy) and others to US date format (mm/dd/yyyy).

When we standardised our PC's it solved our problem.