View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Conan Kelly Conan Kelly is offline
external usenet poster
 
Posts: 22
Default Using Analysis ToolPak funcions in VBA

Zack & Tom,

Thanks again for all of your help. It is much appreciated.

Anyone who knows SQL Server DTS packages and saving them as VB files, I have a question posted at microsoft.public.sqlserver.dts
that I sure could use some help with. Swing on by and take a look.

Conan




"Tom Ogilvy" wrote in message ...
You don't have to set a reference, but the Analysis Tookpak VBA has to be
loaded.

If not reference, use application.Run as shown form the immediate window:

? format(Application.Run ("atpvbaen.xla!eomonth",date,2),"mm/dd/yyyy")
06/30/2006

If the reference is set, you don't use application or
application.WorksheetFunction because it isn't a built in function.

? format(eomonth(date,2),"mm/dd/yyyy")
06/30/2006

so you call it like you would any vba function.

--
Regards,
Tom Ogilvy



"Zack Barresse" wrote in message
...
Hi there Conan,

You must set a reference to it. Tools | References | atpvbaen.xls

(atpvbaen
= Analysis ToolPak VBA ENglish, so adjust for language).

HTH

--
Regards,
Zack Barresse, aka firefytr
To email, remove NOSPAM


"Conan Kelly" <CTBarbarin at msn dot com wrote in message
...
Hello all,

I have the Analysis ToolPak installed so the EOMONTH function is

available
for me to use in Excel, but when I enter

"Application.WorksheetFunction."
in VBA, it doesn't appear in the dropdown list.

Can I use the EOMONTH function in VB code? If so, how?

Thanks for any help anyone can provide,

Conan Kelly