+ Reply to Thread
Results 1 to 9 of 9

run time error 424 object not found

Hybrid View

  1. #1
    Registered User
    Join Date
    05-12-2010
    Location
    Plymouth
    MS-Off Ver
    Excel 2003
    Posts
    3

    run time error 424 object not found

    Im trying to create a data form to upload details to spreadsheet. I have created the form in VBA but when I try and play it i get the error message "run time error 424 object not found." I cant seem to find the problem in the code and have stared at it for so long I feel a bit like an eskino staring at the snow. Any suggestions will be welcome below is the code

    Private Sub cmdCancel_Click()
    
    
        Unload Me
    
    End Sub
    
    
    
    Private Sub cmdClearForm_Click()
    
        Call UserForm_Initialize
    
    End Sub
    
    
    
    
    
    
    Private Sub cmdOK_Click()
    
        ActiveWorkbook.Sheets("Sheet 1").Activate
    
        Range("A3").Select
    
    
        ActiveCell.Value = cboCSR.Value
    
        ActiveCell.Offset(0, 1) = txtDate.Value
    
        ActiveCell.Offset(0, 2) = txtCaseNo.Value
    
        ActiveCell.Offset(0, 3) = txtCallbackDate.Value
    
        ActiveCell.Offset(0, 4) = txtTimeWindow.Value
        
        ActiveCell.Offset(0, 5) = cboAssign.Value
        
        ActiveCell.Offset(0, 6) = txtContactNo.Value
        
        ActiveCell.Offset(0, 7) = txtOrangeNo.Value
    
    
    
            End If
    
        End If
    
        Range("A3").Select
    
    End Sub
    
    
    Private Sub UserForm_Initialize()
    
    txtName.Value = ""
    
    txtDate.Value = ""
        
        With cboCSR
    
            .AddItem "Andy"
    
            .AddItem "Ian"
    
            .AddItem "Vici"
    
            .AddItem "Marcia"
    
            .AddItem "Nina"
    
            .AddItem "Emma"
    
            .AddItem "Wendy"
    
            .AddItem "Dave"
    
            .AddItem "George"
    
            .AddItem "Nick"
    
            .AddItem "Alina"
            
            .AddItem "Janey"
    
            .AddItem "Debbie"
    
            .AddItem "Sharon"
            
            .AddItem "Mark M"
    
            .AddItem "Mark B"
    
            .AddItem "Kayley"
    
            .AddItem "Andrea"
    
            .AddItem "Gill"
    
            .AddItem "Suzanne"
    
            .AddItem "Linda"
    
            .AddItem "Sheena"
    
            .AddItem "Alison"
    
            .AddItem "Katie"
    
            .AddItem "Paula"
            
            .AddItem "Joe"
    
            .AddItem "Gary"
    
            .AddItem "Annie"
            
    End With
    
        cboCSR.Value = ""
        
        txtCaseNo.Value = ""
    
        txtCallbackDate.Value = ""
    
        txtTimeWindow.Value = ""
        
       With cboAssign
    
            .AddItem "Andy"
    
            .AddItem "Ian"
    
            .AddItem "Vici"
    
            .AddItem "Marcia"
    
            .AddItem "Nina"
    
            .AddItem "Emma"
    
            .AddItem "Wendy"
    
            .AddItem "Dave"
    
            .AddItem "George"
    
            .AddItem "Nick"
    
            .AddItem "Alina"
            
            .AddItem "Janey"
    
            .AddItem "Debbie"
    
            .AddItem "Sharon"
            
            .AddItem "Mark M"
    
            .AddItem "Mark B"
    
            .AddItem "Kayley"
    
            .AddItem "Andrea"
    
            .AddItem "Gill"
    
            .AddItem "Suzanne"
    
            .AddItem "Linda"
    
            .AddItem "Sheena"
    
            .AddItem "Alison"
    
            .AddItem "Katie"
    
            .AddItem "Paula"
            
            .AddItem "Joe"
    
            .AddItem "Gary"
    
            .AddItem "Annie"
            
    End With
    
        cboAssign.Value = ""
        
        txtContactNo.Value = ""
    
        txtOrangeNo.Value = ""
        
    End Sub
    Last edited by GingerJah; 05-12-2010 at 06:31 AM.

  2. #2
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: run time error 424 object not found

    Welcome to the Forum

    Add Code tags before the moderators get you!!...

    Forum Rules

    3. 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 # button at the top of the post window. If you are editing an existing post, press Go Advanced to see the # button

  3. #3
    Forum Expert Domski's Avatar
    Join Date
    12-14-2009
    Location
    A galaxy far, far away
    MS-Off Ver
    Darth Office 2010
    Posts
    3,950

    Re: run time error 424 object not found

    And maybe indicate what line is giving you the error message.

    Dom
    "May the fleas of a thousand camels infest the crotch of the person who screws up your day and may their arms be too short to scratch..."

    Use code tags when posting your VBA code: [code] Your code here [/code]

    Remember, saying thanks only takes a second or two. Click the little star to give some Rep if you think an answer deserves it.

  4. #4
    Registered User
    Join Date
    05-12-2010
    Location
    Plymouth
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: run time error 424 object not found

    It is not displaying which line is generatingthe error message

  5. #5
    Forum Expert Bob Phillips's Avatar
    Join Date
    09-03-2005
    Location
    Wessex
    MS-Off Ver
    Office 2003, 2010, 2013, 2016, 365
    Posts
    3,284

    Re: run time error 424 object not found

    Maybe it is the sheet name

    Private Sub cmdCancel_Click()
    	Unload Me
    End Sub
    
    Private Sub cmdClearForm_Click()
    	Call UserForm_Initialize
    End Sub
    
    Private Sub cmdOK_Click()
    	ActiveWorkbook.Sheets("Sheet1").Activate
    
    	With .Range("A3")
    		.Value = cboCSR.Value
    		.Offset(0, 1) = txtDate.Value
    		.Offset(0, 2) = txtCaseNo.Value
    		.Offset(0, 3) = txtCallbackDate.Value
    		.Offset(0, 4) = txtTimeWindow.Value
    		.Offset(0, 5) = cboAssign.Value
    		.Offset(0, 6) = txtContactNo.Value
    		.Offset(0, 7) = txtOrangeNo.Value
    	End With
    
    	Range("A3").Select
    End Sub
    
    Private Sub UserForm_Initialize()
    	txtName.Value = ""
    	txtDate.Value = ""
    
    	With cboCSR
    		.AddItem "Andy"
    		.AddItem "Ian"
    		.AddItem "Vici"
    		.AddItem "Marcia"
    		.AddItem "Nina"
    		.AddItem "Emma"
    		.AddItem "Wendy"
    		.AddItem "Dave"
    		.AddItem "George"
    		.AddItem "Nick"
    		.AddItem "Alina"
    		.AddItem "Janey"
    		.AddItem "Debbie"
    		.AddItem "Sharon"
    		.AddItem "Mark M"
    		.AddItem "Mark B"
    		.AddItem "Kayley"
    		.AddItem "Andrea"
    		.AddItem "Gill"
    		.AddItem "Suzanne"
    		.AddItem "Linda"
    		.AddItem "Sheena"
    		.AddItem "Alison"
    		.AddItem "Katie"
    		.AddItem "Paula"
    		.AddItem "Joe"
    		.AddItem "Gary"
    		.AddItem "Annie"
    	End With
    
    	cboCSR.Value = ""
    	txtCaseNo.Value = ""
    	txtCallbackDate.Value = ""
    	txtTimeWindow.Value = ""
    
    	With cboAssign
    		.AddItem "Andy"
    		.AddItem "Ian"
    		.AddItem "Vici"
    		.AddItem "Marcia"
    		.AddItem "Nina"
    		.AddItem "Emma"
    		.AddItem "Wendy"
    		.AddItem "Dave"
    		.AddItem "George"
    		.AddItem "Nick"
    		.AddItem "Alina"
    		.AddItem "Janey"
    		.AddItem "Debbie"
    		.AddItem "Sharon"
    		.AddItem "Mark M"
    		.AddItem "Mark B"
    		.AddItem "Kayley"
    		.AddItem "Andrea"
    		.AddItem "Gill"
    		.AddItem "Suzanne"
    		.AddItem "Linda"
    		.AddItem "Sheena"
    		.AddItem "Alison"
    		.AddItem "Katie"
    		.AddItem "Paula"
    		.AddItem "Joe"
    		.AddItem "Gary"
    		.AddItem "Annie"
    	End With
    
    	cboAssign.Value = ""
    	txtContactNo.Value = ""
    	txtOrangeNo.Value = ""
    End Sub

  6. #6
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,998

    Re: run time error 424 object not found

    I suspect one of your control names is wrong. When you get the error, press Debug then press f8 repeatedly to step through the code line by line and see where the actual error is.
    Everyone who confuses correlation and causation ends up dead.

  7. #7
    Registered User
    Join Date
    05-12-2010
    Location
    Plymouth
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: run time error 424 object not found

    Thanks for that the line showing as the error are

    the first two after the button commands, they are

    Private Sub UserForm_Initialize()
    txtName.Value = ""

  8. #8
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,998

    Re: run time error 424 object not found

    I'd double check the control name then. If you delete the
    txtName.Value = ""
    line and type
    Me.t
    you should get a list of the properties (including control names) that start with 't' so check if yours is listed.

  9. #9
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: run time error 424 object not found

    Try this

    Private Sub cmdClearForm_Click()
          UserForm1.Show
    End Sub

    You would also save a lot of grief if you were to put your Combo List on a lookup sheet and call the items from there. Either in the properties pane, or via code.

    Also in Private Sub cmdOK_Click()
    You have two "End If"s without an If statement, try this

    Private Sub cmdOK_Click()
        
        With Sheets("Sheet 1").Range("A3")
            .Value = cboCSR.Value
            .Offset(0, 1) = txtDate.Value
            .Offset(0, 2) = txtCaseNo.Value
            .Offset(0, 3) = txtCallbackDate.Value
            .Offset(0, 4) = txtTimeWindow.Value
            .Offset(0, 5) = cboAssign.Value
            .Offset(0, 6) = txtContactNo.Value
            .Offset(0, 7) = txtOrangeNo.Value
        End With
    
    End Sub

    Cheers

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

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