Twsdde.xls (the sample excel file provided by Interactive Brokers) contains a procedure that creates order ID’s using a calculation based on the current date and time. The variable “ongoingID” is defined as type Long. On 8/26/2012 the calculation began producing a value higher than the maximum value for a Long in Excel which is 2147483647 [wiki].
To solve this error I currently recommend the following steps:
From TWS (Trader Workstation) menu:
- Navigate “edit”>global configuration>API
- Press the “Reset Order ID and ID sequence” button
In any workbook that you use such as Twsdde.xls or any custom Excel/VBA workbook used to send orders to IB:
- Open the workbook and press Alt+F11 to open the vba editor
- Press CTRL+F (or use menu) to open the Find (search) box. Search for and change “Const orderMult = 1000000″ to “Const orderMult = 100000″ (one less zero)
Now you should once again be able to successfully send order to IB via Excel.