For years, the minimum steps to get Excel setup to receive data and send orders via DDE with IB were the following.
- Install TWS
- Install the API
- Open TWS and login
- From the TWS menu, Select File>Global Configuration>API>
- Place a check next to “Enable DDE clients”
- open C:\TWS API\samples\excel\twsdde.xls
- Select the “Tickers” tab.
- Enter User Name in B5 (see below if using edemo)
- Select A13 (or any symbol’s row in column A).
- 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.”
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.
- 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.
- Choose “Download for Other Operating Systems” (a list appears).
- 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”.
Alternatively, you can access the 32 bit version from the following link.
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?”
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.