OpenTSAAD ObjOPENSTAAD.Output Results function not working

Dear sir,

I am trying to develop a VBA macro in Excel in order to retrieve Member end displacements from Staad Pro (v20.07.11.82).

The following code is used, with OpenSTAAD functions Shown in Red not working properly. 

Public Sub Check_Deflection()

Dim Input_Worksheet As String
Dim Output_Worksheet As String
Dim Input_Row_P1 As Integer
Dim Input_Row_PA As Integer

Dim BeamNumsCount As Long
Dim BeamNums() As Long
Dim MemberEndDis(6) As Long
Dim MemberForces(6) As Double
Dim MemberNo As Long
Dim MemberEnd As Long ' 0 is start, 1 is End
Dim LoadCase As Long
Dim TempDis(6) As Long

Dim i As Integer
Dim j As Integer
Dim k As Integer
Dim L As Integer
Dim m As Integer
Dim n As Integer
Dim Count As Integer
Dim ObjOPENSTAAD As Object
Dim PrimaryLCs As Integer, LoadCombs As Integer, totalLoads As Integer

Dim STAAD_Path As String
Dim STAAD_Name As String
Dim WB_Path As String
Dim WB_Name As String
Dim stdFile As String

Input_Worksheet = "Results"
Output_Worksheet = "Results"

Worksheets(Input_Worksheet).Activate

STAAD_Path = Range("B1").Value
STAAD_Name = Range("B2").Value

'Get OpenSTAAD Libary and set the file name of the STAAD Document to be interporated.
Set ObjOPENSTAAD = GetObject(, "StaadPro.OpenSTAAD") ' Must have STAAD Model open for this line to work
ObjOPENSTAAD.openstaadfile STAAD_Path & STAAD_Name

'Wait for the STAAD File to load
Application.Wait (Now + TimeValue("0:00:10"))


'Load your STAAD file - make sure you have successfully run the file
ObjOPENSTAAD.GetSTAADFile stdFile, "TRUE"

If stdFile = "" Then
MsgBox "This macro can only be run with a valid STAAD file loaded.", vbOKOnly
Set ObjOPENSTAAD = Nothing
Exit Sub
End If

'check brace and chord member numbers exist in model
BeamNumsCount = ObjOPENSTAAD.Geometry.GetMemberCount()
ReDim BeamNums(BeamNumsCount - 1)
ObjOPENSTAAD.Geometry.GetBeamList BeamNums


'Find out how many primary load cases and load combinations you have:-
PrimaryLCs = ObjOPENSTAAD.Load.GetPrimaryLoadCaseCount()

MemberNo = 6
MemberEnd = 0
LoadCase = 1

ObjOPENSTAAD.Output.GetMemberEndDisplacements MemberNo, MemberEnd, LoadCase, MemberEndDis

For i = 0 To UBound(MemberEndDis()) - 1
Cells(4 + i, 1) = MemberEndDis(i) * 1000
TempDis(i) = MemberEndDis(i) * 1000
Next i

ObjOPENSTAAD.Output.GetMemberEndForces MemberNo, MemberEnd, LoadCase, MemberForces

For i = 0 To UBound(MemberForces()) - 1
Cells(4 + i, 2) = MemberForces(i) * 1000
TempDis(i) = MemberForces(i) * 1000
Next i

'Release OpenSTAAD object
ObjOPENSTAAD.closestaadfile

' Type the following statement to close the instance of the OpenSTAAD object
Set ObjOPENSTAAD = Nothing
End Sub