Using Excel functions from within Access

K

Kemi

Hello:

I just got this function from this forum!

I tested it in a subroutine, but it does not recognize my date format:
mm/dd/yyyy. Then, I tried the excel format of representing dates e.g.
38699 and it worked. How do I modify this code to make it understand
my date format mm/dd/yyyy.

See the code below:

Function fXLNetWork(dtmStart As Date, dtmEnd As Date) As Long
Dim objXL As Excel.Application
Set objXL = CreateObject("Excel.Application")
objXL.Workbooks.Open (objXL.Application.LibraryPath &
"\Analysis\atpvbaen.xla")
objXL.Workbooks("atpvbaen.xla").RunAutoMacros (xlAutoOpen)
fXLNetWork = objXL.Application.Run("atpvbaen.xla!networkdays",
dtmStart, dtmEnd)
objXL.Quit
Set objXL = Nothing
End Function


Thanks a lot.
 

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