A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.
Hi. I have never done this:
Workbook.SetLinkOnData method (Excel)
Sets the name of a procedure that runs whenever a DDE link is updated.
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I have a DDE link established between RSLINX (this is the tag server for an Allen Bradley PLC) and Excel. I'm trying to trigger some VBA code off a change in one cell (A1 as 0 or 1), which is read in Excel from the server as this:
=RSLINX|EXCEL_TEST!'Trigger_to_Excel,L1,C1'
Using the code below, which I grabbed from Microsoft, I can get the Excel code to run, but only if I manually modify the above trigger cell. The update in value through the DDE link does not register as a change, even though the value flips from 0 to 1. Any ideas...???
Private Sub Worksheet_Change(ByVal Target As Range)
Dim KeyCells As Range
' The variable KeyCells contains the cells that will
' cause an alert when they are changed.
Set KeyCells = Range("A1:A1")
If Not Application.Intersect(KeyCells, Range(Target.Address)) _
Is Nothing Then
A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.
Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.
Hi. I have never done this:
Workbook.SetLinkOnData method (Excel)
Sets the name of a procedure that runs whenever a DDE link is updated.
Sub UpdateDDE()
ActiveWorkbook.SetLinkOnData _
"RSLINX|EXCEL_TEST!'Trigger_to_Excel,L1,C1'", _
"RMG"
End Sub