Getting twsdde.xls to work without errors with latest TWS and API

For years, the minimum steps to get Excel setup to receive data and send orders via DDE  with IB were the following.

  1. Install TWS
  2. Install the API
  3. Open TWS and login
  4. From the TWS menu, Select File>Global Configuration>API>
  5. Place a check next to “Enable DDE clients”
  6. open C:\TWS API\samples\excel\twsdde.xls
  7. Select the “Tickers” tab.
  8. Enter User Name in B5 (see below if using edemo)
  9. Select A13 (or any symbol’s row in column A).
  10. Press the “Request Market Data” button.

Currently there are two potential reasons why the above will no longer work. In step 5 above, you will receive an error that says “The ddedll.dll file required for Excel integration is either missing or out of date.”

Screen Shot 2016-01-19 at 1.36.07 PM

The error occurs when the 64 bit version of TWS is installed. DDE is only supported in the 32 bit version. The current download page that IB has in place has an unusual, non-intuitive way to find the link to the 32 bit version.

  1. From the TWS download page, select “TWS Latest” or “Offline TWS Latest”. The “Download” button will appear and the link will be for the 64 bit version that you do not want if using dde.
  2. Choose “Download for Other Operating Systems” (a list appears).
  3. Choose “Windows 32 bit”. The link available from the “Download Button” will change to 32 bit. If you look closely, you’ll also see the small text under the Download button change to “Windows: 32 bit”.

 

tws32

Alternatively, you can access the 32 bit version from the following link.

https://download2.interactivebrokers.com/installers/tws/latest-standalone/tws-latest-standalone-windows-x86.exe

The information below only applies to the edemo account. (The edemo account is provided to the public. It does not require an account unlike a papertrading account. The data is not real, however it’s useful for testing functionality of Excel based programs.)

The second thing that has changed and that is particularly confusing for users who do not have a funded account with a papertrading account with live data is that the edemo account no longer appears to work even when you run the the 32 bit version of TWS and have followed all the the 10 steps at the beginning of this post. Instead, when you use the edemo account, you get an error that says “Remote data not accessible. To access this data. Excel needs to start another application…..”Start application ‘SEDEMO.EXE?”

 

Screen Shot 2016-01-19 at 2.42.33 PM

In a recent update to TWS. It appears that the username “edemo” silently has a number appended like “edemo21”, “edemo22”. This modified username is not obviously visible to the user. Since using twsdde.xls (or my own ATS.xls) requires that you enter the username, it will always fail with the “Remote data not accessible” error when using “edemo”.

The only way, I currently know to find out the modified edemo username that you’ll need to enter into twsdde.xls (or ats.xls on the settings page) is to first login to TWS using edemo (edemo, demouser) and then once connected, disconnect your computer from the internet until you see the following disconnection message appear from TWS. In this case the message says “Logging in edemo161”. Now we know “edemo161” is the correct user name to enter into twsDde.xls or any dde based excel program that accesses IB.

Screen Shot 2016-01-19 at 2.53.21 PM

 

 

 

 

 

Comments

  1. Apprentice says:

    It appears that they shorten or append the username to exactly 7 characters.

    They don't allow a new user creation for less than 8.

    TWS is running with the normal 8+ character name while DDE is trying to connect to "S" + 7 characters.

  2. Hi there,

    does this still work? I use edemo/demouser but I don't get the 'logging in to edemo###' message so there is no way to tell what the correct username should be for the spreadsheet, hence I am getting the 'start application EDEMO.exe' error too. DDE clients are enabled in TWS.

  3. Using then demo acount, i get the message: Loggin in demo_tws
    Entering demo_tws into worksheet as described doesn't work. Have they changed something?

  4. Hi ExcelTrader,

    Please assist: I am getting the error that says “Remote data not accessible. To access this data. Excel needs to start another application…..”Start application ‘SE*username*.EXE?”

    The problem i see is that my username has 123 in the ending but the start application exe code is picking it up till 1 only.
    eg: Username: lmfao123 , Start application ‘Slmfao1.EXE?”

    after which i get "#ref" errors. Please assist

    Thanks
    David

Speak Your Mind