开发者

Runtime Error 424 Object Required

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.


Thanks but that wasn't the problem, the issue was actually in the requestStuff method but the debugger was freezing on that line instead of in the method and silly me forgot to check for that.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜