Help in Extracting end forces from Staad using vba

I have written vba codes several times before and I don't have any problem. After 3 years, I am writing a code again to extract beam end forces but the forces extracted were way too far from the results. I get a lot of zeros or a too big value. I can't seem to find a solution. Can someone help me?

Can someone send me a message if you can help me. Thanks

 

  • We tested a simple macro written in an Excel file and it works OK. Here is the code.

    Private Sub CommandButton1_Click()

    Dim lMemberNo As Long
    Dim lEnd As Long

    Dim lLoadCase As Long
    Dim dForceArray(6) As Double

    Dim icount As Integer
    Dim ret As Boolean

    lMemberNo = Cells(1, 2).Value
    lLoadCase = Cells(2, 2).Value

    Set staad = GetObject(, "StaadPro.OpenSTAAD")

    ret = staad.Output.GetMemberEndForces(lMemberNo, lEnd, lLoadCase, dForceArray)

    For icount = 0 To 5

    Cells(7, 2 + icount).Value = dForceArray(icount)

    Next

    Set staad = Nothing

    End Sub