I am trying to debug some code that uses the Analysis Toolpak Workday function

Please Login or Register  to view this content.

The variables above are as follows:
varTemp(0, inti)=12/02/2014
dtReconDate=17/02/2014
-varTemp(5, inti) + 1=-3
Dim varHolidays As Variant is a series of dates
varHolidays = QueryDatabase("SELECT dt from tCalender2 where IsHoliday = True", DBConn, False)' this is a series of dates


Here is the code without the variables; the data is hardcoded in instead. varHolidays is a Variant assigned from a select statement (a collection of dates)
Please Login or Register  to view this content.

I don't know what ATPVBAEN.xla!Workday does but I can't use it as I am getting an error. I want to use worksheetfunction.workday instead but this requires arguments to be passed in. I don't know what I could pass in to make the code above work in the same way.
worksheetfunction.workday takes three arguments, I don't know if they have to be of a certain type.