View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
gc gc is offline
external usenet poster
 
Posts: 13
Default Date problems when importing txt files

Hello,

I have an application that reads data into Access. It accepts different file
types (.txt, .xls), opens them in excel, then manipulates the data and stores
the date in SQL-Server. The files cannot be opened manually (there are lots
of them!), but using the command:

dim booki As Excel.Workbook
set booki = General.Excel.Workbooks.Open(fileName)

Where fileName is the file name provided by the user.

The problem is that when providing a .txt file, Excel reads the date as
mm/dd/yyyy,
while I need it as dd/mm/yyyy. My regional setting is set to dd/mm/yyyy, but
it seems to be ignored.

It is intersting that when I open the .txt files manually, the dates are
formatted correctly (dd/mm/yyyy)!

Does anyone have any idea how to solve the problem? I tried to formatNumber
the date column, but even this does not help!
I tried both on win2000 and xp - and I am using excel 2003 and Acess 2003.

Thanks!
GC.