Error 424 : Object required

V

vivmaha

I have a class module called "Node" which has a method with the following
heading: Public Sub ini()

From another module, "module2", I have the following code:
Dim root As Node
Set root = New Node
root.ini

When I try to run this, i get "Runtime error 424: Object required".
What am I doing wrong?
 
J

JMB

With this in a standard module:
Sub test()
Dim root As Node
Set root = New Node
root.ini
End Sub

and this in a class module called "Node"
Public Sub ini()
MsgBox "Hello"
End Sub

I don't get any errors. Perhaps you should step through your code (F8) and
see exactly where your code fails (there are several useful tools under Debug
that can help you figure out what is going wrong and where - F8 will step
through your code one line at a time).
 
V

vivmaha

Thank you. I thought by clicking 'debug' on the error message I would get to
the exact line that crashed. F8 carried me to the real line.
 
J

JMB

Glad to help.

vivmaha said:
Thank you. I thought by clicking 'debug' on the error message I would get to
the exact line that crashed. F8 carried me to the real line.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top