Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>If you are open to a VBA solution, you can use the <code>Workbook.SetLinkOnData</code> method to call a Sub when the incoming data changes.</p> <p>I would suggest only responding to changes on the <code>TIME</code> topic, and copying all relavent data in one go</p> <p>Based on this data layout</p> <p><img src="https://i.stack.imgur.com/f0yTy.jpg" alt="Based on this data layout"></p> <p>Set up the monitor on the Open event (place this in the <code>ThisWorkbook</code> module)</p> <pre class="lang-vb prettyprint-override"><code>Sub Workbook_Open() Dim wb As Workbook Dim Links As Variant Dim i As Long Set wb = ThisWorkbook Links = wb.LinkSources(xlOLELinks) For i = LBound(Links) To UBound(Links) If Left$(Links(i), 8) = "MT4|TIME" Then wb.SetLinkOnData Links(i), "MT4_OnUpdate" End If Next End Sub </code></pre> <p>And code your data handler in a normal module</p> <pre class="lang-vb prettyprint-override"><code>Sub MT4_OnUpdate() ' DDE Updated TIME, copy data Dim ws As Worksheet Dim Source As Range Dim Dest As Range Set ws = Worksheets("Your DDE Data Sheet") With ws Set Source = ws.Range("A2:E2") Set Dest = .Cells(.Rows.Count, 1).End(xlUp).Offset(1, 0).Resize(1, Source.Columns.Count) End With Dest.Value = Source.Value End Sub </code></pre> <p>This will copy cells <code>A2:E2</code> to the bottom of the Historical data list, each time <code>A2</code> (time stamp from MT4) changes.</p> <p>Note: you say in your OP that you want to update every millsecond. This can't happen, because <code>MT4|TIME</code> is returning a DateTime serial which has a resolution of 1 second. And even if it could happen, that would be way too much data for Excel to handle</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload