XL5: EOMONTH() Function Off by One Day

ID: Q115399

5.00 5.00c WINDOWS kbusage

The information in this article applies to:

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

Version           : 5.00 5.00c
Platform          : WINDOWS

Last Reviewed: September 14, 1996