View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Ron Rosenfeld Ron Rosenfeld is offline
external usenet poster
 
Posts: 5,651
Default how to use workdays or networkdays in VBA

On Wed, 22 Mar 2006 19:26:31 -0800, ABG wrote:

I have a macro that needs either Workdays or networkdays to determine the
number of workdays in a month.
I have installed the "Analysis Tool Pack" and "Analysis Took Pack - VBA"
into Excel.
I am trying to use "application.worksheetfunction.networkdays(... ..)"
however after I enter the "." there is no reference to either "Workdays" or
"Networkdays" from the object browser.

When I run the macro, it errors out with Run-time error 438 - Object does
not support this property or method.

Does anyone know why this is happening, and what I can do to correct this?

Thank-you


In the VB editor, Tools/References atpvbaen.xls

Then in your macro, just use:

Var = workdays(dt,num)


--ron