+ Reply to Thread
Results 1 to 10 of 10

Compile Error:

  1. #1
    Forum Contributor
    Join Date
    02-24-2010
    Location
    Dublin, Ireland
    MS-Off Ver
    Excel 2003
    Posts
    195

    Arrow Compile Error:

    Byref Argument Type Mismatch.

    I got a simple variable definition problem thats driving me crazy because I know its somthing so simple but For some reason I just cant see it.

    Can anybody spot the problem

    Please Login or Register  to view this content.

  2. #2
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,436

    Re: Compile Error:

    Is that all the code?

    Looks like your missing a End Sub at least.
    Cheers
    Andy
    www.andypope.info

  3. #3
    Forum Contributor
    Join Date
    02-24-2010
    Location
    Dublin, Ireland
    MS-Off Ver
    Excel 2003
    Posts
    195

    Re: Compile Error:

    Sorry Andy, just forgot to copy and paste in, but yes, all Subs are closed off correctly.

  4. #4
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,436

    Re: Compile Error:

    Really hard to say without code to compile and see the error.
    Example file would make things easier.

    Are all the variable names used correctly. You have a potential for public and private variables to be confused due to missing letter. Although the posted code looks fine.

    NapsMonth instead of NapMonth

    Is the click event code in a sheet object or userform object?

  5. #5
    Forum Contributor
    Join Date
    02-24-2010
    Location
    Dublin, Ireland
    MS-Off Ver
    Excel 2003
    Posts
    195

    Re: Compile Error:

    Hey Andy,
    I have a Object 'Comandbutton' that brings up the Userfrom Object.

  6. #6
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,436

    Re: Compile Error:

    Some one else maybe able to see the problem from the code you posted by I can not.

    As I said earlier you really need to post example file that illustrates the problem.

  7. #7
    Forum Expert Whizbang's Avatar
    Join Date
    08-05-2009
    Location
    Greenville, NH
    MS-Off Ver
    2010
    Posts
    1,395

    Re: Compile Error:

    Put
    Please Login or Register  to view this content.
    at the top of your module, and then try to compile. If you have misspelled variables anywhere, it will tell you right away, instead of you searching.

  8. #8
    Forum Contributor
    Join Date
    02-24-2010
    Location
    Dublin, Ireland
    MS-Off Ver
    Excel 2003
    Posts
    195

    Re: Compile Error:

    Ahhh I got this.

    I had the below piece of code at at start of the Userform code.
    I've deleted it and it has popped back in at the bottem of the code. Now it works fine.

    Can anybody explain to me what this code is for and why it cant be deleted?


    Private Sub UserForm_Click()

    End Sub

  9. #9
    Valued Forum Contributor mohd9876's Avatar
    Join Date
    05-04-2011
    Location
    Amman, Jordan
    MS-Off Ver
    Excel 2010
    Posts
    426

    Re: Compile Error:

    there is no problem if you delete this code but when you double click on the user form it will automatically insert the mouse click event. if you want to jump to the code pane without inserting this module just right click on the user form and select view code

  10. #10
    Forum Contributor
    Join Date
    02-24-2010
    Location
    Dublin, Ireland
    MS-Off Ver
    Excel 2003
    Posts
    195

    Re: Compile Error:

    Ahh I see, Cheers for that lads.

+ 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