Re: worksheetfunction with networkdays

Tech-Archive recommends: Fix windows errors by optimizing your registry



I am a happy camper. This code works OK (or seems to).
maxdays = 0
(I just pick an empty cell anywhere)
range("p4").Select
ActiveCell.FormulaR1C1 = "=NETWORKDAYS(37547,now(),0)"
maxdays = ActiveCell.Value

This code doesn't:
maxdays=application.worksheetfunction.networkdays(37547,31765,0)
Thanks very much for the help. Somehow, checking the box "notify me of
replies" doesn't seem to take????. I have checked both aptvbaen and funcres
everywhere I can find them.
--
Bill Roberts


"Roger Govier" wrote:

Hi Bill

I wouldn't do that - just yet!!!
Have you also checked atpvbaen.xls in Tools>References in the VB Editor?

If, after doing that as well, it doesn't work, try
maxdays = [atpvbaen.xls].networkdays(32790, 31765, 0)

That information came from Chip Pearson's site following the reference that
Ron gave in his posting.
--
Regards
Roger Govier

"Bill Roberts" <BillRoberts@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:D7B3F481-211E-45E3-A25A-8EE629EC3BC6@xxxxxxxxxxxxxxxx
Sorry I didn't get back sooner, but I guess I didn't check "notify me of
replies"
I am running Excel 2000 (as a part of Office 2000). Both atlvbaen and
funcres are called out as addins and as references, but I can't seem to
get
any command to work. Just get that or similar error message. Would you
recommend I just update to Excel2007??
--
Bill Roberts


"Roger Govier" wrote:

Hi Bill

Tools>Addins>check both Analysis Toolpak and Analysis Toolpak - VBA

--
Regards
Roger Govier

"Bill Roberts" <BillRoberts@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:3B96C991-8E3B-49F3-988F-E84D1EAC71FC@xxxxxxxxxxxxxxxx
My simple line of code in a macro is
maxdays=application.worksheetfunction.networkdays(32790,31765,0)
Every variation gives some error code, but the most common is "Error
code
438. Object doesn't support this property or method."
Other work*** functions work just fine, and networkdays works just
fine
when I use it to enter the number in a cell. It just won't work in a
macro.
TIA
--
Bill Roberts

.


Quantcast