XL5: EOMONTH() Function Off by One Day

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.

Additional query words:

Keywords :
Version : 5.00 5.00c
Platform : WINDOWS
Issue type :


Last Reviewed: September 13, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.