+ Reply to Thread
Results 1 to 9 of 9

Run-time Error '424'

  1. #1
    Registered User
    Join Date
    07-26-2011
    Location
    Evansville, IN
    MS-Off Ver
    Excel 2003
    Posts
    5

    Run-time Error '424'

    So I am new to using this VBA stuff and I keep getting a Run-Time Error '424' that says Object Required. If I click Debug, I get a yellow arrow that doesn't seem to tell me very much except that I have an error in that line but I don't know why or how to fix it.

    I was hoping someone here might be able to help me. I just want a calendar to pop up whenever I click the cell B4. It sounded simple enough but things just aren't working right now.

    Here is what I have in my code-- maybe you can tell me whats wrong.


    Private Sub Calendar1_Click()
    ActiveCell.Value = CDbl(Calendar1.Value)
    ActiveCell.NumberFormat = "mm/dd/yyyy"
    ActiveCell.Select
    Calendar1.Visible = False
    End Sub

    Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    If Target.Cells.Count > 1 Then Exit Sub
    If Not Application.Intersect(Range("B4"), Target) Is Nothing Then
    Calendar1.Left = Target.Left + Target.Width - Calendar1.Width
    Calendar1.Top = Target.Top + Target.Height
    Calendar1.Visible = True
    ' select Today's date in the Calendar
    If Not IsDate(Target.Value) Then
    Calendar1.Value = Date
    Else
    Calendar1.Value = Target.Value
    End If
    ElseIf Calendar1.Visible Then Calendar1.Visible = False
    End If
    End Sub

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Run-time Error '424'

    Welcome to the forum.

    Please take a few minutes to read the forum rules, and then edit your post to add CODE tags.

    Thanks.
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Registered User
    Join Date
    07-26-2011
    Location
    Evansville, IN
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: Run-time Error '424'

    Please Login or Register  to view this content.

  4. #4
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Run-time Error '424'

    ... except that I have an error in that line but I don't know why or how to fix it.
    What line?

  5. #5
    Registered User
    Join Date
    07-26-2011
    Location
    Evansville, IN
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: Run-time Error '424'

    The error shows up in the third line from the bottom that says

    Please Login or Register  to view this content.

  6. #6
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Run-time Error '424'

    Try this, assuming you have the calendar control installed:

    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    07-26-2011
    Location
    Evansville, IN
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: Run-time Error '424'

    I get the same error when I try that.

    This time the yellow arrow is next to the line that says.

    Please Login or Register  to view this content.
    I think the error has to do with the Calendar object and not as much with the code because I got it to work earlier and then it stopped working.

  8. #8
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Run-time Error '424'

    Do you have the calendar control installed?

  9. #9
    Registered User
    Join Date
    07-26-2011
    Location
    Evansville, IN
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: Run-time Error '424'

    I thought I did. It worked before so I don't know why it would uninstall. Is there a way to check?

+ 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