I use DDE to load nine tickers and four account pages (connecting to four open TWS instances) into an Excel spreadshset. I never have problems with lost data.
Thats because of bugs in Excel, not DDE. DDE Uses a windows message. It is guaranteed to be delivered on the local system. When was the last time you pressed a key on your keyboard and Windows "lost the message"? Since Windows NT 3.x was released in 1993, windows messages don't get lost because there is a buffered message queue and a badly written application can't crash/hang the entire machine. DDE is a very fast, very reliable, very efficient protocol.
Hi. Does anyone here know how I can fire off or simulate a click in excel using VB 6 code? I have an Excel sheet with a command button. I would like to be able to click on that button every 10 seconds but Excel does not have a simple timer. The easy thing for me would be to have a small VB form, put a timer control and every 10 seconds fire off a timer event which clicks the XL button. Any suggestions? Thanks
I think the sleep API will do the trick. First declare the Sleep API: Private Declare Function Sleep Lib "kernel32"(ByVal dwMilliseconds As Long) Then just do this whenever you want your code to wait 1 second before executing: Call Sleep(1000) 'Sleeps for 1 second. Maybe put that in a loop and it'll execute whatever you want every 1 second.
I have a sheet which computes options statistics. I need to download underlying last price so I use Excel DDE from mytrack and/or esignal. I have cells which has the formula for bringing in data like. =IBM!last. It works but the problem starts when I need to clear cell(s) in order to free up system resources. I would go cells(1,1).formula ="". The formula disappears in the cell, the cell stops updating BUT the system still sees excel using 30-50% of CPU time even though nothing is happening in the sheet. If I exit,save and reopen XL the Excel releases the CPU. Would you know a way to "clear" or "sever " the link w/o having to exit out of Excel? Thanks
Thanks for the suggest. Will try it. Problem with DDE programming is that it works fine at night when the mkts are closed, it gets the price for 50 tickers and since mkt is closed it only updates 50 times. Now trading begins and the faults show up since all 50 have last prices coming in like gangbusters.
Attached a .txt file that contains the code for a timer in Excel works just fine for us... we use it all the time in various ways this is just a timer event that throws data from a worksheet into a txt file... we also do inserts to SQL Server (msde2000 actually)... and other stuff... hope this helps... post any clear questions... cj... _________________ HAVE STOP - WILL TRADE If You Have The Vision We Have The Code
Thanks cj, will try that tomorrow. I was able to simulate a timer in Excel , kinda doing a recursive call to itself using the ontime method. The problem happens when you want the timer to stop NOW and since it is recursive, it will stop 1 loop AFTER you say stop. And that extra loop is when my buy orders get filled on downdrafts and vice versa. LOL.. Thanks again.