Here's the solution for IB API ver 9.71. It appears that Matlab does not work with later versions of API.
1. Uninstall the API component by navigating to Control Panel -> Program and Features 2. Locate and delete the following files if they are still present:
C:\Windows\System32(SysWOW64)\TwsSocketClient.dll C:\Windows\System32(SysWOW64)\MsFlxgrd.ocx C:\Windows\ddedll.dll
If the problem still persists, you may have to register the Tws.ocx file manually. It is essential that you run CMD or command in Administrator, even though you login as local administrator. Please follow the below steps:
1. Copy Tws.ocx (C:\TWS API\bin\ActiveX\ to the following directory: C:\Windows\System32(SysWOW64)\ 2. Click the Search Windows icon (Magnifier glass) and in the Search area, type "cmd” 3. Right click the "Command Prompt" banner, and select "Run as Administrator" 4. At the command prompt, enter: %systemroot%\System32(SysWOW64)\regsvr32.exe Tws.ocx 5. This should successfully register your Tws.ocx.