Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]() <<<<<<<Regardless, I would think that Workbooks.Open (as you did originally) would simply pass the information to Excel to open the workbook. Therefore, I would not think that would cause the cell to look differently in Excel (if that is what you mean), unless Workbooks.Open chooses a different default format for dates. (Seems unlikely.) In any case, even if the __appearance__ of the date is different, I would expect the actual date value assigned to a type Double variable or viewed with a Number format would be the same. The actual value itself is different when I open it via VBA macro (workbooks.open). ie 41220 and 41101 if you convert to a number. There my code which is evaluating the value treats it as a different date. (7/11/2012 instead of 11/7/2012) <<<<<<<<More importantly (perhaps; depends on context), what does Month(...the date...) return in VBA? I indeed call the month function and get it returned as 11 instead of 7. What I mean by visually is that when I step through the VBA code as look at opened file in Excel the date i 7/11/2012. If I just open the file manually in excel it is 11/7/2012. Anyway, using workbooks.opentext after changing name to a txt file works fine it seems. So happy to use this. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Incorrect date format when opening txt or csv files via macro | Excel Programming | |||
Compare dates (one cell not in date format) | Excel Discussion (Misc queries) | |||
switched date format opening dbf file | Excel Programming | |||
Date format when opening a .CSV file programmatically | Excel Programming | |||
Opening Add-in files manually | Excel Programming |