Calling Excel function in Access

  • Thread starter Thread starter RichardO
  • Start date Start date
R

RichardO

Hello all:

I have a Networkdays function that I currently use in Excel
Networkdays(start date, end date, holidays). I have stored th
(holidays) in the formula in a named range in excel.

Access does not have the networkdays function. Please explain to me i
detail how I can call the Networkdays function from Excel to Access?

Thanks a lot.


RichardO
 
What is your networkdays function actually doing?

you could either write it in the access db or call an excel object an
run the function, these are just 2 ways. it depends on what you
function is trying to achieve.

Are you trying to return the value to access, just do the processing i
excel.

Little more info please
 
Please explain to me in detail whether you did any research: MSDN,
Usernet archive? This question comes up regularly:

What?! OPs should research before asking questions? Next thing you'll write is
that they should read the manual. How old-fashioned!

With regard to your Google link, many solutions involving either Automation or
web components. If Access can use udfs in queries, then wouldn't it be faster to
count workdays directly?


Function SimpleNWD(begdate As Date, enddate As Date) As Long
Dim i As Date,

If begdate > enddate Then
SimpleNWD = -1
Exit Function
End If

For i = begdate To enddate

Select Case Weekday(i)

Case vbSaturday, vbSunday
'do nothing

Case Else
SimpleNWD = SimpleNWD + 1

End Select

Next i

End Function


Including holiday handling makes this a bit more complicated, but overly so.
 
Hello all:

Thanks Matt for replying. The Networkdays function find the number o
business days between 2 dates and also puts into consideratio
holidays.

I would like to call an excel object, in this case: Networkday
function (it's an add-in), run this function in a query in Access (i.e
return the value in Access). Do you know how exactly I would call thi
function exactly. If so, PLEASE provide me with the detailed steps.

Thanks a lot in advance.


Richardo
 
Thanks Matt for replying. . . . ...
I would like to call an excel object, in this case: Networkdays
function (it's an add-in), run this function in a query in Access (i.e.
return the value in Access). Do you know how exactly I would call this
function exactly. If so, PLEASE provide me with the detailed steps.

If you preferred Matt's response, you should have followed up to his response
rather than mine. Anyway, here's the most succinct of the Google archive
articles you could have found using the link in onedaywhen's response.

http://groups.google.com/[email protected]

It contains links to sites that provide the hand-holding you're seeking. If that
still is too much work for you, realize that you're asking an **ACCESS**
question, not an Excel question (i.e., 'how do I do X in Access?' where X just
happens to be calling an Excel function). Consider following up to an Access
newsgroup. They seem to be as used to this sort of request as we here are to
multiple condition COUNTIF/SUMIF.
 
Back
Top