Results 1 to 3 of 3
  1. #1
    Join Date
    Jun 2004

    Unanswered: Price function in modules

    I am writing modules in Access for price function in excel.
    However, the result is not what I wanted. can anyone help me correct it?

    Function fXLPrice(SETTLE_DATE As Date, MATURITY_DATE As Date, INT_RATE As Double, YTM As Double, REDEMPTION As Double, INT_PAY_FREQ As Byte, BASIS As Byte) As Double
    ' Uses the Excel function PRICE to return the security's price per $100 face value.
    ' Accepts:
    ' SETTLE_DATE - The security's settlement date
    ' MATURITY_DATE - The security's maturity date
    ' INT_RATE - The security's annual coupon rate
    ' YTM - The security's annual yield
    ' REDEMPTION - The security's redemption value per $100 face value
    ' INT_PAY_FREQ - the frequency of the payments per year
    ' BASIS - The type of day count to use
    ' Returns:
    ' The PRICE
    On Error GoTo E_Handle
    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)
    fXLPrice = objXL.Application.Run("atpvbaen.xla!price", SETTLE_DATE, MATURITY_DATE, INT_RATE, YTM, REDEMPTION, INT_PAY_FREQ, BASIS)
    Set objXL = Nothing
    Exit Function
    MsgBox Err.Description, vbOKOnly + vbCritical, "Error: " & Err.Number
    Resume fExit

  2. #2
    Join Date
    Nov 2003
    Since we don't have any of the required files....what is the result you are looking for?

  3. #3
    Join Date
    Jun 2004

    Ans to the price


    the answer should be 93.3984675 but my answer is 93.25

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts