XL5: EOMONTH() Function Off by One Day

Last reviewed: September 12, 1996
Article ID: Q115399
The information in this article applies to:
  • Microsoft Excel for Windows versions 5.0, 5.0c

SYMPTOMS

In Microsoft Excel 5.0, if you use the EOMONTH() function with the Visual Basic, Applications Edition, ExecuteExcel4Macro method, the resulting date will be off by one day.

WORKAROUND

To return the correct day of the month, modify the function so that one day is added to the result. For example, you would change the following line of code

   MsgBox Format(ExecuteExcel4Macro("EOMONTH(TODAY(),0)"), "m/d/yy")

to:

   MsgBox Format(ExecuteExcel4Macro("EOMONTH(TODAY(),0)") + 1, "m/d/yy")

STATUS

Microsoft is researching this problem and will post new information here as it becomes available.


KBCategory: kbusage
KBSubcategory:

Additional reference words: 5.00


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: September 12, 1996
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.