EOMONTH function not working

CJBIRKIN

Drink!
Local time
Today, 06:20
Joined
May 10, 2002
Messages
256
Hello

I am trying to use the spreadsheet function EOMONTH(DATE,month) in a module.

The help says i need msowcf.dll installed which i have found in
\Microsoft Office\office\

but the function isn't recognised. Is there a library i also need or is it something else?


Cheers

Chris
 
Hello

With just enough hair left for a comb over while i wait for it to grow back the problem was solved with.

Public Function ENDOFMONTHDATED(WAITDATED As Date, MONTHED As Integer) As Date

Dim classopt As New MSOWCFLib.OCATP
ENDOFMONTHDATED = classopt.EOMONTH(WAITDATED, MONTHED)
End Function


Chris
 
I don't think the function is available in both Excel and Access. What the function returns? The last date of a given month, 28, 29, 30 or 31? If so, try the function below.

Function EndOfMonth(dte As Date) As Date
Dim MyDate As Date
MyDate = DateSerial(Year(dte), Month(dte) + 1, 1)
MyDate = DateAdd("d", -1, MyDate)
EndOfMonth = MyDate
End Function
 

Users who are viewing this thread

Back
Top Bottom