Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Rob Rob is offline
external usenet poster
 
Posts: 234
Default Unwanted date conversion when opening a workbook

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Unwanted date conversion when opening a workbook

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" wrote in message
...
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

Any help?

Thanks
Rob



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,253
Default Unwanted date conversion when opening a workbook


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


?B?Um9i?= wrote:

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

Any help?

Thanks
Rob


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel 2007 General Formating Unwanted Text to Date Conversion RRTRACKS77 Excel Discussion (Misc queries) 5 December 17th 08 07:14 AM
Opening at Unwanted TexJen09 Excel Discussion (Misc queries) 1 December 9th 08 02:17 AM
Unwanted data conversion in cells WordsmithDan Excel Discussion (Misc queries) 2 July 6th 07 12:34 AM
unwanted csv date conversion Lori Gordon Excel Discussion (Misc queries) 1 October 10th 05 11:02 PM
unwanted number to date conversion while pasting data from web Jacek Excel Worksheet Functions 1 February 24th 05 02:59 PM


All times are GMT +1. The time now is 10:40 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"