vb question (DDE Excel + IB's TWS)

Discussion in 'Automated Trading' started by travis, Feb 8, 2006.

  1. travis

    travis

    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.
     
    #11     Feb 9, 2006
  2. We forgot to mention that we all get a cut of your profits (but not losses) for the assistance.

    :)
     
    #12     Feb 9, 2006