PSS ID Number: 114628
Article Last Modified on 1/17/2001
The information in this article applies to:
- Microsoft Visual Basic for Applications 1.0
This article was previously published under Q114628
SYMPTOMS
When you run a macro that formats a number with a date, time, currency, or
standard number format in a Visual Basic, Applications Edition module, the
format in the macro is different from the format displayed in the
International dialog box of Control Panel.
This behavior occurs when your Country setting in the International dialog
box is set to one of the following: Austria, Canada (French), Hungary,
Slovak Republic, Croatia, Romania, Serbia, or Slovenia.
The following is a list of Country settings and the different date formats
displayed in the International dialog box of Control Panel and in a Visual
Basic module:
Country International Visual Basic
displays displays
--------------------------------------------------------------------
Austria Short Date: 1994-5-6 1994-5-Friday
Canada (French) Short Date: 94/5/6 94-5-6
Hungary Long Date: 1994. May 6 1994 May 6.
Short Date: 1994.5.6 1994.5.6.
When the following country settings are used
Croatia
Romania
Serbia
Slovenia
a macro in a Visual Basic module displays date, time, currency, and
numbers as United States formats.
CAUSE
Austria
This incorrect date format is caused by a problem in Microsoft Windows.
When you set the Country setting to Austria in the International dialog
box, the [intl] section of the WIN.INI file has the following incorrect
setting:
This causes the date in Visual Basic modules to be formatted with
the full day name.
Canada(French)
This incorrect date format is caused by a problem in Microsoft Windows. The
[intl] section in the WIN.INI file has the following inconsistent settings:
sDate=/
sShortDate=yy-mm-dd
The date separators in these settings should be consistent. (The default
should be the hyphen (-) character.)
Hungary
This incorrect date format is also caused by a problem in Microsoft
Windows. In the [intl] section in the WIN.INI file, both the sShortDate and
the sLongDate settings correctly show a period at the end. The Visual Basic
module uses these correct settings to format a date. In this case, the
format of the dates in the International dialog box are incorrect.
Croatia, Romania, Serbia, and Slovenia
Visual Basic, Applications Edition does not recognize the Croatia, Romania,
Serbia, and Slovenia system locales. For languages that are not recognized,
date, time, currency, and number formats in Visual Basic modules use the
default United States/English International settings.
More information about this is available in the XLREADME.HLP file. To view
this file, do the following:
- In Microsoft Excel, press F1 to run Help.
- From the File menu, choose Open. From the File Name list, select
XLREADME.HLP and choose OK.
- Select the Microsoft Excel Product Update topic.
- Scroll down to the Unrecognized System Locales topic.
WORKAROUND
Austria
To work around this problem and display the correct short date format in a
Visual Basic module, do the following:
- Run Windows Control Panel and choose the International icon.
- Under Date Format, choose Change, then choose OK.
- In the International dialog box, choose OK.
Canada(French)
To correct this inconsistency, do the following:
- Run Windows Control Panel and choose the International icon.
- Under Date Format, choose Change.
- Under Short Date Format in the Separator box, type / (backslash) or
- (hyphen) to set the date separator you
want to use. Choose OK.
- In the International dialog box, choose OK.
Keywords: KB114628
Technology: kbVBA100 kbVBASearch kbZNotKeyword3 kbZNotKeyword6