Sub oslodde() Dim image As Variant Dim rddata, thdata As Variant ' Activate a worksheet.VarType(IntVar) Worksheets(1).Activate ' Initiate a Channel to OSLO Command Topic. chan1 = Application.DDEInitiate("OSLODDE", "OSLO_Command") ' Initiate a Channel to OSLO GlobalData Topic. chan2 = Application.DDEInitiate("OSLODDE", "GlobalData") ' Open a lens in the private directory Application.DDEExecute chan1, "open len pri len trip.len" ' Get the number of surfaces image = Application.DDERequest(chan2, "IMS") ' Add some labels Range("A1") = "Radius" Range("B1") = "Thickness" rddata = Application.DDERequest(chan2, "rd") thdata = Application.DDERequest(chan2, "th") ' Fill in the cells in column 1 with radius values For i = 0 To image(1) Range("A" & i + 2) = rddata(i + 1) Range("B" & i + 2) = thdata(i + 1) Next i ' Close Connection Application.DDETerminate (chan1) Application.DDETerminate (chan2) End Sub