vb question (DDE Excel + IB's TWS)

Miracle! I had a successful contribution from a guy on a forum. This time it seems to work perfectly. If you add to the top of my file (I attached it on my second post on this thread) this code, then everything works and it doesn't freeze:

Dim valori(1) As Double

Private Sub Worksheet_Calculate()
On Error Resume Next

If Cells(2, 3).Value + Cells(4, 3).Value = valori(0) + valori(1) Then Exit Sub
valori(0) = Cells(2, 3).Value
valori(1) = Cells(4, 3).Value

---------

Essentially, this code tells the sub routine "calculation" to not calculate unless there are changes on those two famous cells.

Thanks to everyone for your precious help. Without your advice I would have not been able to pin down the exact problem. Great forum.
 
Back
Top