Using add-in functions on a form

P

Peter

Can somebody please help me!

I wish to use the function 'WORKDAY' in a VBA routine available from the
Analysis Tool-pak Add-Ins.
I have ticked off the Analysis Toolpak and Analysis Toolpak - VBA
I have used it successfully in a cell so I am sure the format is correct.
E.G. =IF(L3 <> "",WORKDAY(L3,AA3,Holiday_List),"")
The result is a date advanced by the value in cell AA3 excluding weekends
and public holidays.
Cell L3 has a date and cell AA3 has an integer number while 'Holiday_List'
has a range of dates.

Below is the code on a form where 'TBoxSDate' is a date and 'TboxDaysPt' is
an integer number.
This is the line:
lblPayDte = Application.WorksheetFunction.WORKDAY(TBoxSDate,
TboxDaysPt,Holiday_List)

When coding the function 'WORKDAY' is not listed after WorksheetFunction so
I realise that it is not available. Why?

When running the form and invoking the line above, it says 'Object Required'

Are Add-in functions noy available within a form?

Peter Bircher
 
B

Bob Phillips

Peter,

Set a reference to the addin in the VBE (Tools>Reference), as well as in
Excel, and then you can call the routine directly.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
P

Peter

Thank you.
That makes sense!
Peter

Bob Phillips said:
Peter,

Set a reference to the addin in the VBE (Tools>Reference), as well as in
Excel, and then you can call the routine directly.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top