View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
JLatham JLatham is offline
external usenet poster
 
Posts: 2,203
Default Excel VBA 2003: how do I call an Analysis ToolPak function within

In addition to 'installing' the Analysis ToolPak along with 'Analysis ToolPak
- VBA', in the VB Editor, set a Reference (Tools -- References) to
atpvbaen.xls
It should be in the list of available library references. Then you can code
it simply as:

Sub TestEOMonth()
Dim newDate As Date

newDate = eomonth("1/1/2010", -1)
MsgBox newDate
End Sub


"Hershmab" wrote:

Analysis ToolPak is installed in my application and I need to use the result
of EOMONTH function in a UDF I am writing. These functions are clearly not
amongst the properties/methods of APPLICATION.WORKSHEETFUNCTIONS.

I tried this syntax:
PrevMthEnd = [atpvbaen.xla]!EOMONTH(Date, -1)
but it also does not work.

How should it actually be worded?