Runtime Error 424 Object Required

Posted by Luis on Stack Overflow See other posts from Stack Overflow or by Luis
Published on 2010-06-04T20:34:03Z Indexed on 2010/06/05 19:22 UTC
Read the original article Hit count: 446

Filed under:
|
|
|
|

Hey so I get this error in this code:


Private Sub Request_Stuff_button_Click()
    Call Main.createObjects
    Call My_Control.requestStuff
End Sub

at the 'Call My_Control.requestStuff' line. The 'Main' module looks like this:


Public My_Control As ControlObject

Public Sub createObjects()
    If My_Control Is Nothing Then
        Set My_Control = New ControlObject
    End If
End Sub

The weirdest thing is that when I add

Dim x As Integer
x = My_Control.dummyInt

right before the line that gets me the error, x gets the correct value right before the error happens which means My_Control is definitely an object and is definitely not nothing.

This error is killing me, thanks in advance.

© Stack Overflow or respective owner

Related posts about vb.net

Related posts about vba