Hello All,
I am getting a run-time error with the following piece of code while using it in access 2007.
Sub Command19_Click()
Dim objExcel As Excel.Application
Dim p(4) As Double
p(0) = -10000
p(1) = 2750
p(2) = 4250
p(3) = 3250
p(4) = 2750
Dim d(4) As Date
d(0) = #1/1/1998#
d(1) = #3/1/1998#
d(2) = #10/30/1998#
d(3) = #2/15/1999#
d(4) = #4/1/1999#
Set objExcel = New Excel.Application
objExcel.RegisterXLL objExcel.Application.LibraryPath & "\ANALYSIS\ANALYS32.XLL"
Debug.Print objExcel.Run("XIRR", p, d, -0.1) ' Result: 0.374858599901199
objExcel.Quit
Set objExcel = Nothing
End Sub
I am getting the following Runtime Error:
Run-time error '1004':
Cannot run the macro 'XIRR'. The macro may not be available in this workbook
or all macros may be disabled.