Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Retrieving Dates From Excel

Status
Not open for further replies.

mavest

Programmer
Feb 27, 2003
54
US
Does anyone know how Excel stores its data? I would like to guarantee that what my customer in Germany enters as a date in a cell will be retrieved by me (in the US) exactly as my German client entered it.

Example:

G Client enters using a VBA macro:
worksheets("Sheet1").cells(1,1).value = "9/3/2003"

viewed in european format as 09-Mar-2003

G Client sends me the Excel workbook:

Obviously in US format I would view this as 03-SEP-2003 (which is wrong), but I do not want to view it in Excel. I want to retrieve it with an OLE action from another application.

Does anyone know that when Excel stores "9/3/2003" does it store it exactly as the given string or does it convert it to a date or time and store that?? I want to insure that my application will retrieve "9/3/2003" when it retrieves the value of cell(1,1), so that I can do the european to us date conversion myself.

Thanks for your help!!

-Mike
 
The date is stored in Excel as a numerical value (try applying the "general" number format to a cell with a date or time value). So the data does not depend on the international settings, although of course the presentation on-screen will change.
Rob
[flowerface]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top