"OLE Automation Run-time Error 440" When Displaying Time

Last reviewed: July 29, 1997
Article ID: Q123970
The information in this article applies to:
  • Microsoft Excel for Windows, versions 5.0, 5.0c
  • Microsoft Project for Windows, version 4.0

SYMPTOMS

When you use the Visual Basic, Applications Edition, Time function to display the current system time, you may receive the following error message:

   Run-time error '440':
   OLE Automation error

CAUSE

The Time function is unable to convert the system time using the settings that are specified in the International Settings in Control Panel. This problem will occur if the following entries are missing from the [intl] section of the WIN.INI file:

   sShortDate=M/d/yy
   sLongDate=dddd', 'MMMM' 'd', 'yyyy
   sLanguage=enu
   sCountry=United States

WORKAROUND

To work around this problem, add the following line to the [intl] section of the WIN.INI:

   sShortDate=M/d/yy
   sLongDate=dddd', 'MMMM' 'd', 'yyyy
   sLanguage=enu
   sCountry=United States

You can also force the correct setting to be written to the [intl] section by making certain changes in Control Panel. To add the appropriate settings, use the following steps:

  1. In Windows Control Panel, double-click the International icon.

  2. In the Date Format section, choose the Change button.

  3. In the Short Date Format section, choose the Change button. Select (put an x in) the Day Leading Zero and Month Leading Zero check boxes.


Additional query words: xl5 prj4 "run-time error 440"
Keywords : kbenv kbprb kbprg
Version : 5.00 5.00c
Platform : WINDOWS


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: July 29, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.