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.
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.