+ Reply to Thread
Results 1 to 6 of 6

Opening a user form on start up error '424'

  1. #1
    Registered User
    Join Date
    06-02-2011
    Location
    London, England
    MS-Off Ver
    Excel 2003
    Posts
    6

    Opening a user form on start up error '424'

    HI All

    Ive been following the guide to making a booking form on this site

    Ive checked the VBA code numerous times and i cant see what im doing wrong.

    Ive even copied the code directly from the 'download sample excel' file on the website, into my created doc. and it wont work?! Ive also copied my code into the downloaded doc. and that works!!

    Ive put the following code in ThisWorkbook (Code):

    Please Login or Register  to view this content.
    but i get a runtime error '424' Object required

    Can anyone help?

    I'm very new to this so obviously doing something ridiculous!
    Last edited by ben.martin; 06-22-2011 at 11:19 AM.

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Opening a user form on start up error '424'

    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code. Posting code without them makes your code hard to read and difficult to be copied for testing. Highlight your code and click the # at the top of your post window. For more information about these and other tags, found here
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: Opening a user form on start up error '424'

    ben.martin,

    In the code you provided, its looking for a userform named frmCourseBooking. After you created the userform with Insert > UserForm, did you change the name of the userform from UserForm1 to frmCourseBooking? If you did not, then that is why you're getting the error. Otherwise, the problem is somewhere in the UserForm_Initialize event code. In the link you provided, the Initialize code references the following controls that are expected to be on the userform:

    txtName - Textbox
    txtPhone - Textbox
    cboDepartment - Combobox
    cboCourse - Combobox
    optIntroduction - OptionButton
    chkLunch - Checkbox
    chkVegetarian - Checkbox

    If you do not have those controls, named as shown, then you will also receive that error message.

    Hope this helps,
    ~tigeravatar
    Last edited by tigeravatar; 06-22-2011 at 11:21 AM. Reason: OP added code tags, returning post to original

  4. #4
    Registered User
    Join Date
    06-02-2011
    Location
    London, England
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: Opening a user form on start up error '424'

    sorry about that chaps. code changed. appreciate the help

  5. #5
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Opening a user form on start up error '424'

    Thank you

    The error will be found in the UserForm code, probably Initialize event

  6. #6
    Registered User
    Join Date
    06-02-2011
    Location
    London, England
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: Opening a user form on start up error '424'

    Thankyou tigeravatar and royUK

    In checking that i definitely had all the controls on the userform i realised i had called one of them cmb rather than cbo.

    Sorry for wasting your time and for posting incorrectly first time round.

    Thanks again

    Ben

+ 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