I wrote a very simple VBA function in Excel 2000 and it uses a call to NETWORKDAYS. I had to enable the Analysis TookPak and it works well.
I sent the workbook to a friend to admire however, he's using Excel 2007 and has problems with my VBA function. I added the attached code to resolve but still....no luck. Any idea what I'm doing wrong?
mike
I sent the workbook to a friend to admire however, he's using Excel 2007 and has problems with my VBA function. I added the attached code to resolve but still....no luck. Any idea what I'm doing wrong?
Code:
VB6 = Val(Application.VBE.Version) < 6.5
If VB6 Then
number_of_days = [atpvbaen.xls].NETWORKDAYS( _
event_start_time, _
event_end_time, _
Sheets(seasons_sheet_name).Range(holiday_table_name))
Else
number_of_days = WorksheetFunction.NETWORKDAYS( _
event_start_time, _
event_end_time, _
Sheets(seasons_sheet_name).Range(holiday_table_name))
End If
mike