How to add a reference load with a load factor to a load case using openSTAAD commands

Hi,

I have the below code which interfaces with a matrix i have created in excell/VBA. 

I want to create the loadcase, this code works, and then add the reference load say "R1" to the load case with a load factor as per the image below. The reference loads have already been created successfully. How can I achieve this?

'Define Load Cases

Dim RefLoadNo As Double
Dim RefLoadName As String
Dim RefLoadType As Long


Dim LoadCaseName As String
Dim LoadCaseType As Long
Dim LoadCaseNo As Double
Dim LoadFactor As Double

For j = 2 To UBound(Load_Matrix(), 2) 'i=2 at start as i=0 is the loacombination row and i=1 is loadcombination name row

LoadCaseName = Load_Matrix(1, j)
LoadCaseType = 22 ' Type "NONE"
LoadCaseNo = Load_Matrix(0, j)
ObjOPENSTAAD.Load.CreateNewPrimaryLoadEx2 LoadCaseName, LoadCaseType, LoadCaseNo ' in form LoadCaseName, LoadCaseType, LoadCaseNo

For i = 2 To UBound(Load_Matrix(), 1)
RefLoadNo = CDbl(RemoveFirstChars(CVar(Load_Matrix(i, 0)), 1))                   ' this results in a reference load case number of 1 rather than R1.
LoadFactor = Load_Matrix(i, j)
ObjOPENSTAAD.Load.AddLoadRefEx2 LoadCaseNo, RefLoadNo, LoadFactor ' in form LoadCase, Node, Factor
Next i

Next j

Best Regards, 

Tom