Unwanted date conversion when opening a workbook

R

Rob

I have a document, saved as text from another application (business objects) which contains the value 01/06/2004 (1st June 2004) in cell A5

When I open the workbook mannually I see the correct date, but when I open it with code (workbooks.open("path.xls")) it comes up with 01/06/200

Any help

Thank
Rob
 
T

Tom Ogilvy

What version of Excel.

How do you open it in code?

Generally, VBA treats a date as US format if it can. Excel 2002 had some
additional options/settings to handle this as I recall.

--
Regards,
Tom Ogilvy

Rob said:
I have a document, saved as text from another application (business
objects) which contains the value 01/06/2004 (1st June 2004) in cell A5.
When I open the workbook mannually I see the correct date, but when I open
it with code (workbooks.open("path.xls")) it comes up with 01/06/2004
 
K

keepitcool

if it's a text file you could/should open it:

set wb=workbooks.opentext("path.txt")

see opentext method in vba help for all the params you can set.

some of the array settings may seem complicated, _
but just give it a few tries with the macrorecorder running ...



keepITcool

< email : keepitcool chello nl (with @ and .) >
< homepage: http://members.chello.nl/keepitcool >
 
Top