+ Reply to Thread
Results 1 to 2 of 2

wrong number of arguments or invalid property assignment

  1. #1
    Registered User
    Join Date
    07-25-2012
    Location
    singapore
    MS-Off Ver
    Excel 2003
    Posts
    1

    wrong number of arguments or invalid property assignment

    I am a newby to VBA and this is my first attempt at a function.

    Function Deltawt(PortfolioValue As Double, PortfolioFloor As Double, Maturity As Double, Riskfree As Double, Volatility As Double)

    d1 = (Log(PortfolioValue / PortfolioFloor) + (Riskfree + (Volatility ^ 2) / 2) * Maturity / 365) / (Volatility * sqrt(Maturity / 365))

    Deltawt = NormSDist(d1)

    End Function

    When i try to run it, the SQRT() and NORMSDIST() function calls do not compute. I clicked on the property box to allow Excel addins but that doesnt help. If I omit the sqrt and normsdist it works (but clearly these are critical to the formula!)

    Your guidance is gratefully received...thq

  2. #2
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: wrong number of arguments or invalid property assignment

    those are not vba functions so you need to use the worksheetfunction object (or use the native vba sqr function for the square root)
    Please Login or Register  to view this content.
    Josie

    if at first you don't succeed try doing it the way your wife told you to

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1