I'm trying to avoid putting DDE links directly into Excel cells and instead establish the links in VBA and store the returned data into a VBA array. I'm getting tripped up on the very first step however, because I can't establish the DDE links in VBA (and as a result receive no data to populate my array with). Here is what I am trying to use into to get the market data via DDE:
Dim chan As Long, App as String, Topic as String, data As Variant, Item as String
I've tried numerous variations of 'Item', but 'data' always returns as empty. (I suspect that the problem lies in what I am using for 'Item', but I'm not certain.) Does anyone have suggestions on how I can get this to work or what I'm doing wrong? Could be a problem with the general approach, but my feeling is that it is an IB specific syntax issue. I've tried gettting answers from IB customer service but would have been better off using a ouija board. Appreciate any suggestions.
I must be stupid but I thought you needed to enter the formula in an excel cell to create a DDE link, be it to retrieve datas, submit orders or anything else.
Ha. Don't worry, I'm sure when this is resolved one way or the other, I'll be the stupid one. Anyhow, I believe the above method should return into the 'data' variable the same information that would populate an Excel cell with formula:
OK, so far I have noticed that is you first set up a Control Link (that's the one that has SecType, Exchange, Currency etc in it) in a spread-sheet, you can then get data using your syntax in VBA. Maybe the Control Link should go somewhere in DDEInitiate or DDERequest to get it all done in VBA only.. Haven't figured out where and using what syntax yet... That's one sh1t reference guide that IB has for DDE - not even a mention of either DDEInitiate or DDERequest in it.