NetworkDays not defined in VBA

Dear Experts,

The question I have is not new to EE, but the existing answers do not help. Here's my Problem:
I have an Excel solution from the days with Office 2003 that extensively uses functions (NetworkDays, Weekdays) from the "Analysis Toolpak - VBA". This all worked fine in the old environment. Now I need to get it to work with Office 2010. But, even after ensuring that the "nalysis Toolpak - VBA" is enabled in Excels Add-In manager and the reference to atbvbaen.xls is checked in the VBA reference dialogue, I still get the following error:
"Sub or Function not defined"

Any ideas are more than welcome
WebJoeAsked:
Who is Participating?
 
Rory ArchibaldCommented:
It requires an array of serial numbers for the dates - so an array of Long or Double will work. (You can still pass dates to the array and they will be converted as required)
0
 
Rory ArchibaldCommented:
The ATP functions are now built into Excel, so you can use Application.Networkdays or Application.WorksheetFunction.Networkdays without requiring any additional references.
0
 
WebJoeAuthor Commented:
Thank you, rorya, the prefix "Application." made the error mentioned above go away. But it still does not work, now I get an error 13 (type mismatch).
I cann the function with three arguments: The first two are dates and the third is an array of dates.

It looks like the new NetworkDays does not like the array of dates as set for additional holidays - but what format/data type does it accept?
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.