Results 1 to 5 of 5
  1. #1
    New Lounger
    Join Date
    Nov 2003
    Location
    Seattle, Washington, USA
    Posts
    19
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Compile Error 450 with Left() function (2002, SP2)

    I have a macro that runs fine when executed from any global or non-global template (including Normal.dot) except one--the global template I keep all my macros in! I have copied it into several modules within this particular template, and it won't work in any of them. In particular it generates compile error 450, "Wrong number of arguments or invalid property assignment," on the Left() and Right() functions. For example, this macro generates the error, but again, only when executed from this one particular template:

    Sub macro()
    MsgBox (Left("abc", 1))
    End Sub

    The modules in this template have no global declarations. Does anyone have any idea what could be different about this template? All the other macros in it work fine (dozens of them).

    Thanks!

    Earl Morton

  2. #2
    3 Star Lounger
    Join Date
    Apr 2004
    Location
    Boston, Massachusetts, USA
    Posts
    389
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Compile Error 450 with Left() function (2002,

    I'm sure you've checked for this, but are you sure you don't happen to have a macro somewhere else in that template named "left"?

  3. #3
    Plutonium Lounger
    Join Date
    Nov 2001
    Posts
    10,550
    Thanks
    0
    Thanked 7 Times in 7 Posts

    Re: Compile Error 450 with Left() function (2002, SP2)

    I have seen very similar errors when I have modified a template using a later version of Word and then moved it back to an earlier version. This was fixed by looking in Tools > References - but I can't remember exactly which library caused the problem.

    StuartR

  4. #4
    New Lounger
    Join Date
    Nov 2003
    Location
    Seattle, Washington, USA
    Posts
    19
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Compile Error 450 with Left() function (2002,

    Thanks, Andrew! That was the problem. I changed the names of my Left() and Right() macros, and this one works fine now. (I should know better than to name macros with standard function names!)

    Earl

  5. #5
    New Lounger
    Join Date
    Nov 2003
    Location
    Seattle, Washington, USA
    Posts
    19
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Compile Error 450 with Left() function (2002, SP2)

    Thanks, Stuart! That wasn't the problem this time, but it is something worth watching out for.

    Earl

Posting Permissions

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