Extracting a line's coordinates with VBA error

Hello,


I am trying to extract the coordinates of a line's start and end points which I have selected with my VBA macro. I tried using for example with just the x-coordinate:

this.GetElement().Segments[0].Start.X

or

this.GetElement().StartPoint.X

but none of those work. I get the error "Object required". I am using Microstation V8 2010 version. 

The purpose of the code is to find a line with select by attributes, get the coordinates of the line's start and end point to be able to place a line somewhere along the line. Can anyone help me with this? 

Here is the code so far:

Sub Macro1()
Dim startPoint As Point3d
Dim point As Point3d, point2 As Point3d
Dim lngTemp As Long
Dim StartX

' Start a command
CadInputQueue.SendCommand "MDL SILENTLOAD SELECTBY dialog"

CadInputQueue.SendCommand "SELECTBY EXECUTE"

Dim modalHandler As New Macro1ModalHandler
AddModalDialogEventsHandler modalHandler

' The following statement opens modal dialog "Alert"

CadInputQueue.SendCommand "SELECTBY EXECUTE"

RemoveModalDialogEventsHandler modalHandler
CommandState.StartDefaultCommand

this.GetElement().startPoint.X

' Select place point
CadInputQueue.SendCommand "PLACE POINT"

End Sub

Thanks in advance