Problem accessing networkdays function

richard.ca

Board Regular
Joined
Nov 7, 2007
Messages
100
Hi All,

I seem to be having a problem accessing the networkdays function from VBA
(Excel 2000). Despite having installed the Analysis Toolpak add-in I can't get
networkdays to appear as a method of the Application object. I also tried
Application.WorksheetFunction (I know there were changes between Excel 2000/2003
but can't recall which syntax applies to which version). Alas it doesn't make any
difference.

Anyone any ideas?

Thanks,

Richard.
 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.

Andrew Poulsom

MrExcel MVP
Joined
Jul 21, 2002
Messages
73,092
You need to install Analysis Toolpak - VBA (Tools|Add-Ins), and set a reference in your workbook to ATPVBAEN.xla. Then you will be able to use NetWorkdays without qualification - it's not a member of the Application object, but of the Add-In.
 

richard.ca

Board Regular
Joined
Nov 7, 2007
Messages
100
Must be missing something. I installed the Analysis Toolpak as you described and I
already see a reference to ATPVBAEN in my VBA project window but I still get
'function/variable not defined' when I try to call NetWorkdays as in:

Code:
MsgBox NetWorkdays(Cells(Target.Row, sdat_col_num), Cells(Target.Row, doby_col_num))
 

Andrew Poulsom

MrExcel MVP
Joined
Jul 21, 2002
Messages
73,092
You have to add a reference to your workbook. Click your workbook in the project window and choose Tools|References from the menu. Check ATPVBAEN and click OK.
 

Watch MrExcel Video

Forum statistics

Threads
1,130,448
Messages
5,642,218
Members
417,262
Latest member
andrewd1

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top