Announcement

Collapse
No announcement yet.

How can I make DDE links update during execution of a Visual Basic program?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • How can I make DDE links update during execution of a Visual Basic program?

    I have written a Visual Basic for Applications (VBA) program from within Excel. One of the things the program does is create DDE links to eSignal for a collection of symbols in the Excel spreadsheet. Then the program is designed to de several other things.

    But no matter what I try, the cells with DDE links do not populate themselves with the linked data until the VBA application ends. I have tried issuing Wait commands (i.e., Application.Wait) and created various loops that basically delay the application to allow time for the cells to get populated. I have also tried all the Calculation and link refresh commands and tests, such as:
    --Calculate
    --Application.Calculate
    --Application.CalculateFull
    --Application.CalculateFullRebuild
    --Workbooks(x).RefreshAll
    --If Application.CalculationState - xlDone Then... (to loop into calculation procedures until all has been calculated, etc.)

    Any help would be greatly appreciated

  • #2
    Hey ! Thanks for your reply!

    I've pretty much given up on it. Instead I have found outside applications to do what I want. Esignal ActiveX will only allow me to export price and time data to these other SDK's so that I can calculate the technical values that I want, to use in the manner that I want.

    If this is an incorrect assumption, please let me know.
    wnik_e

    Comment


    • #3
      Have you tried the a Do Events Loop ?

      Comment


      • #4
        I have tried a Do Events loop, thanks. The bloody DDE links just won't update themselves until the computer is just sitting there idle, and it doesn't recognize a Visual Basic Do Events loop or even a time delay loop as sitting idle. I think the Do Events command doesn't work because DDE links are probably not considered system events covered by the Do Events command.

        But trying Do Events was a great suggestion. You seem to know a lot about this stuff. Do you have any other suggestions?

        Comment


        • #5
          The way to get around the problem is to have 2 macros. The second is launched with a 2-5sec launch delay after the first macro which requests the the DDE, so that the system has time to update the DDE links.
          Cumbersome, but I have not found a better solution.

          OLiver

          Comment


          • #6
            DDE Link documentation

            I'm having similar problems - perhaps because my documentation on DDE is out of date.

            Can anyone point me to the location of the latest documentation?

            Thanks

            Comment

            Working...
            X