+ Reply to Thread
Results 1 to 4 of 4

Type Mismatch Errors...

  1. #1
    Registered User
    Join Date
    05-21-2007
    Posts
    79

    Type Mismatch Errors...

    I keep getting type mismatch errors here, and I'm not sure why...

    Please Login or Register  to view this content.
    g is declared as a long for no good reason, but I left it that way. It's sent to this function ByVal. AutoAssign is a function that returns a long-type number from the Test.xls workbook. I don't understand why I'm getting an error at the first call of AutoAssign. It's telling me there's a type mismatch with y, in the function call.

    Any suggestions?

  2. #2
    Forum Contributor
    Join Date
    01-21-2005
    Location
    Colorado
    MS-Off Ver
    2000,2003,2007
    Posts
    481
    Try passing your variable to AutoAssign simply as y rather than ByVal y

    AutoAssign(y)

    HTH

  3. #3
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591
    Hi

    I'm pretty sure you only use the byval when you are declaring a function / sub. So remove it from the function call and see how you go.


    rylo

  4. #4
    Registered User
    Join Date
    05-21-2007
    Posts
    79
    I figured it out... the function AutoAssign takes a Long type variable, and the declaration of y wasn't explicit. Once I declared y as Long it worked again.

    Thanks for the suggestions!

+ 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