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

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand
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.
 
Upvote 0
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))
 
Upvote 0
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.
 
Upvote 0

Forum statistics

Threads
1,214,923
Messages
6,122,289
Members
449,077
Latest member
Rkmenon

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
Back
Top