Object not accessible- invalid object refference

Hello!
I wrote JUST this code in the sub:

 Dim a As Object
 Set a = New Point
 a.X=4
 a.Y=1
 MsgBox a._X

But getting the error from above.
Please, what is missing- in a sub?

Many thanks!

I’m pretty sure you found the code from here: [BASIC] Object-Oriented Programming (View topic) • Apache OpenOffice Community Forum

A more careful reading would have had you create a new module, just as in instructions:

If one enters above code in a module
called « Point » the name of the class
will be also « Point ».