2

I'm following the steps from How to open a specific bloomberg terminal page programmatically? to control a Bloomberg terminal window via DDE (ActiveX/Javascript):

xlApp = new ActiveXObject("Excel.Application");
var app = xlApp.DDEInititate("winblp", "bbk");
xlApp.DDEExecute(app,"<blp-1><home>MSFT US<EQUITY><GO>DES<GO>");
xlApp.DDETerminate(app);
app = "";
xlApp.Quit();

However the callt o DDEInitiate is failing (IE8) with 'Object doesn't support this property or method' -- I can see the xlApp has been defined and an equivalent call in Visual Basic seems to work just fine:

ch = DDEInitiate("winblp", "bbk")

Can anyone determine why the javascript isn't working?

Thank you

Ryan

Community
  • 1
  • 1
Ryan
  • 3,924
  • 6
  • 46
  • 69

1 Answers1

3

I've had the same issue, and I'm fairly convinced at this point that there is no way of doing this with javascript. I've had no problem with vbscript, so here it is if it helps:

<html>
<body>

<input id="button1" type="button" value="Bloomberg Test" onclick="button1_onclick()" />

<script type="text/vbscript" src="test2.vbs"></script>

</body>
<html>

test2.vbs:

Sub button1_onclick()
    Dim ch
    Dim oXL

    Set oXL = CreateObject("Excel.Application")

    ch = oXL.DDEInitiate("winblp", "bbk")
    oXL.DDEExecute ch, "<blp-3><home>AAPL US<EQUITY><GO>BRC<GO>"
    oXL.DDETerminate ch

    oXL.Quit
End Sub
hexboy
  • 79
  • 1
  • 5