Excel Date re-formatting
Posted by Des Feeley on August 12, 1999 6:04 AM
Hi,
perhaps this is not your thing
but it is doing my head in, so to speak
I have a one line excel 97 vba macro, shown below ...
Sub main()
Workbooks.Open FileName:="datetrial.csv"
End Sub
The file "datetrial.csv" contains one line!!!
Date 1,05/08/1999
I'm in Europe, so it's the fifth of August to me.
Okay here is the question ... If I run the one line macro, to open the one line file, direct
from the excel vba window (i.e. F5 or the 'Play' button), then it works fine, 05/08/1999 in cell B1
If I create a button on the excel toolbar, and link this button to the macro ("main") when it
opens the file, it reverses the date format!!! As in it inputs the date as 08/05/1999. The format of the cell is set to Custom dd/mm/yyyy, which makes no sense at all.
Something different is happening when I run line of code from the Button toolbar.
any thoughts?
(I have come across something similar in the Microsoft knowledge base, but they have no resolution suggested.
Article Q172588)