Results 1 to 10 of 10

Runtime Error 424: Object Required - help with starting User Form

This is a discussion on Runtime Error 424: Object Required - help with starting User Form within the Excel Questions forums, part of the Question Forums category; Every time I try to run this application that I created, I am getting this error. I am VERY new ...

  1. #1
    New Member
    Join Date
    Dec 2014
    Posts
    6

    Default Runtime Error 424: Object Required - help with starting User Form

    Every time I try to run this application that I created, I am getting this error. I am VERY new to VBA (as in...I began using it yesterday) so I really don't have any idea what I'm doing. I copied a basic format that I found online and tailored it to my needs.

    I am trying to start a userform that, after the user populates and hits submit, will automatically fill in on another worksheet. The problem is that when I hit the "start" button (which should start the app), it comes up with this error.

    This is the code I have for the "start" command button:

    Sub CommandButton1_Click()


    CoaterUserForm.Show


    End Sub


    When I hit debug, the "CoaterUserForm.Show" line is highlighted and an arrow pointing at it.

    Again, please bear with me because I am very new. Please explain everything you can in simple terms! This may be a simple, obvious fix - but I can't figure it out.

    Thanks!

  2. #2
    MrExcel MVP
    Moderator
    RoryA's Avatar
    Join Date
    May 2008
    Location
    UK
    Posts
    29,785

    Default Re: Runtime Error 424: Object Required - help with starting User Form

    First, are you certain that that is the correct name of your form? If so, when the error arises, click debug, then press f8 to step into the actual userform code and see which line is really causing the error - probably in the Initialize or Activate events of the form.

  3. #3
    New Member
    Join Date
    Dec 2014
    Posts
    6

    Default Re: Runtime Error 424: Object Required - help with starting User Form

    That is the name on the left side list when I'm in VBA and in the "Name" section of the properties list. I think it is the correct name.

    When I press F8, that same line is highlighted in yellow AND red and there is a little red dot on the left.

  4. #4
    Board Regular Norie's Avatar
    Join Date
    Apr 2004
    Location
    Stirling
    Posts
    72,001

    Default Re: Runtime Error 424: Object Required - help with starting User Form

    Do you have any code in the userform's Initialize or Activate events?
    If posting code please use code tags.

  5. #5
    New Member
    Join Date
    Dec 2014
    Posts
    6

    Default Re: Runtime Error 424: Object Required - help with starting User Form

    This is the code for the UserForm Initialize event:


    Code:
    Private Sub UserForm_Initialize()
    'Empty NameBox
    NameBox.Value = ""
    
    
    'Empty DateBox
    DateBox.Value = ""
    
    
    'Empty BatchBox
    BatchBox.Value = ""
    
    
    
    
    'Empty LinearMeterBox
    LinearMeterBox.Value = ""
    
    
    'Empty LineSpeedBox
    LineSpeedBox.Value = ""
    
    
    'Empty OrderBox
    OrderBox.Value = ""
    
    
    'Empty OrderYardsBox
    OrderYardsBox.Value = ""
    
    
    'Empty RollBox
    RollBox.Value = ""
    
    
    'Empty SquareMeterBox
    SquareMeterBox.Value = ""
    
    
    'Empty WidthBox
    WidthBox.Value = ""
    
    
    'Empty ActivityList
    ActivityList.Clear
    
    
    'Fill ActivityList
    With ActivityList
        .AddItem "Operations"
    End With
    
    
    'Empty ProductList
    ProductList.Clear
    
    
    'Fill ProductList
    With ProductList
        .AddItem "Products"
    End With
            
    'Set partial order as default
    OptionButton1.Value = True
    
    
    End Sub
    Last edited by RoryA; Dec 30th, 2014 at 09:09 AM. Reason: Added code tags

  6. #6
    Board Regular Norie's Avatar
    Join Date
    Apr 2004
    Location
    Stirling
    Posts
    72,001

    Default Re: Runtime Error 424: Object Required - help with starting User Form

    That code looks fine.

    You might want to have a look here Office Update breaks ActiveX controls | Excel Matters.
    If posting code please use code tags.

  7. #7
    New Member
    Join Date
    Dec 2014
    Posts
    6

    Default Re: Runtime Error 424: Object Required - help with starting User Form

    I actually figured it out just now. I looked back at another bunch of code and saw that I have a line in there that wasn't necessary. Now, the user form loads, but I get an error after I hit submit. It says:

    Compile Error:
    End If without block If

    Can I just get an explanation on what this means? I can try to troubleshoot it myself but I don't quite understand what it's telling me.

  8. #8
    MrExcel MVP
    Moderator
    RoryA's Avatar
    Join Date
    May 2008
    Location
    UK
    Posts
    29,785

    Default Re: Runtime Error 424: Object Required - help with starting User Form

    The red highlight and dot is a breakpoint - you can click the red dot to clear it again.

    In the VB Editor, click Tools - Options, switch to the General tab and alter the Error Trapping options to 'Break in class module' then click your startup button again.

    Your error usually means that you have an If clause where the Then clause appears on the same line, in which case you don't use an End If. In other words you have something like:
    Code:
    If something then do something
    end if
    but it should either be just:
    Code:
    If something then do something
    or:
    Code:
    If something then 
    do something
    End If
    Last edited by RoryA; Dec 30th, 2014 at 09:13 AM.

  9. #9
    Board Regular Norie's Avatar
    Join Date
    Apr 2004
    Location
    Stirling
    Posts
    72,001

    Default Re: Runtime Error 424: Object Required - help with starting User Form

    Can you post the code for the submit button?
    If posting code please use code tags.

  10. #10
    New Member
    Join Date
    Dec 2014
    Posts
    6

    Default Re: Runtime Error 424: Object Required - help with starting User Form

    RoryA, thanks for the explanation. I took out the End If and that error code went away.
    Thanks again for the help. Like I said, most of this is probably obvious to seasoned veterans but it's a huge mystery to me

Tags for this Thread

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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


DMCA.com