Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / March 2006

Tip: Looking for answers? Try searching our database.

how to use workdays or networkdays in VBA

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
ABG - 23 Mar 2006 04:26 GMT
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
Ron Rosenfeld - 23 Mar 2006 04:48 GMT
>I have a macro that needs either Workdays or networkdays to determine the
>number of workdays in a month.
[quoted text clipped - 10 lines]
>
>Thank-you

In the VB editor, Tools/References  atpvbaen.xls

Then in your macro, just use:

Var = workdays(dt,num)

--ron
ABG - 23 Mar 2006 05:01 GMT
THANK-YOU Ron.

I forgot the aptvbaen.xls!

I guess this is where I slap myself on the back of the head and chalk it up
to an ID 10 T error!  (I get a lot of those!)

> >I have a macro that needs either Workdays or networkdays to determine the
> >number of workdays in a month.
[quoted text clipped - 18 lines]
>
> --ron
Ron Rosenfeld - 23 Mar 2006 08:42 GMT
>THANK-YOU Ron.
>
>I forgot the aptvbaen.xls!
>
>I guess this is where I slap myself on the back of the head and chalk it up
>to an ID 10 T error!  (I get a lot of those!)

I find I get more of those the older I get :-))

Glad to help
--ron
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.