+ Reply to Thread
Results 1 to 5 of 5

Compile Error: Wrong number of arguments or invalid property assignment

  1. #1
    Registered User
    Join Date
    01-10-2012
    Location
    Charlotte, NC
    MS-Off Ver
    2010 and 2013
    Posts
    7

    Question Compile Error: Wrong number of arguments or invalid property assignment

    I've been struggling with this error message all day: Compile Error: Wrong number of arguments or invalid property assignment

    I have a UserForm set up, and when I click submit, it runs some code (about 50 lines). However, it seems to get hung up in this section:
    Please Login or Register  to view this content.
    It highlights the first "Range" above and gives me the compile error. I commented out that line, and re-ran. It went to the next "Range" and highlighted that with the same error message.

    I did some research, and it seems the typical culprit would be for me to have declared a sub somewhere else called "Range". But I looked, and there is no such sub called Range.


    Any idea, or maybe something to look at first? I can't seem to make any progress debugging this one. Thanks.

  2. #2
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Compile Error: Wrong number of arguments or invalid property assignment

    I suspect this line

    Please Login or Register  to view this content.
    Have you tried stepping over the code using the F8? When you do, the code will stop on that line when there is an error.

  3. #3
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: Compile Error: Wrong number of arguments or invalid property assignment

    I expect what you meant was

    Please Login or Register  to view this content.
    or
    Please Login or Register  to view this content.
    Entia non sunt multiplicanda sine necessitate

  4. #4
    Registered User
    Join Date
    01-10-2012
    Location
    Charlotte, NC
    MS-Off Ver
    2010 and 2013
    Posts
    7

    Re: Compile Error: Wrong number of arguments or invalid property assignment

    Quote Originally Posted by AB33 View Post
    I suspect this line

    Please Login or Register  to view this content.
    Have you tried stepping over the code using the F8? When you do, the code will stop on that line when there is an error.
    That's correct, when I run the macro, the first word (Range) in that line you quoted is highlighted blue (not yellow, as I'm accustomed to seeing with VBA errors) I suppose it's because it's a compile error, and the top line (Private Sub, etc) is highlighted yellow.

    I tried stepping over the code using F8, but it doesn't find anything wrong in that code.

  5. #5
    Registered User
    Join Date
    01-10-2012
    Location
    Charlotte, NC
    MS-Off Ver
    2010 and 2013
    Posts
    7

    Re: Compile Error: Wrong number of arguments or invalid property assignment

    Quote Originally Posted by shg View Post
    I expect what you meant was

    Please Login or Register  to view this content.
    or
    Please Login or Register  to view this content.
    YES, of course it's a parentheses issue. Thanks for the eagle-eye!

+ 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