How to assign values to Point and Vector variables?

I have tried to assign values as in this sub:

Sub Assign()
    Dim P As Point, v As Vector
    P.x = 5
    P.y = 4
    v.x = 1
    v.y = -3
End Sub

I receive RTE message 91, "Object valiable or with block variable not set".

What am I doing wrong? There seems to be no method for assignment.

Best regards

Holger

Parents
No Data
Reply
  • I am not very well trained in programming, but I think the problem is that you have not created instances of either the Point or the Vector.

    If I want to work with a ShapeRange, I can't simply have:

    dim sr as ShapeRange

    and then start adding shapes to it.

    I could use:

    dim sr As New ShapeRange

    and then add shapes to it.

    Or, I could have:

    dim sr as ShapeRange

    set sr = ActiveSelectionRange

    and then do something with that ShapeRange.

Children
No Data