hi!
I have a workbook with several links to DDE server.
The link source is an external file on a server to which I have no direct access, and updates come automatically at random intervals.
I would like to know if there is a way to write the code that will show me a message box every time a link is updated.
Are there any distinguishable properties to those links?
ideally I want to work like this: message box "link two in cell B1 updated", message box "link one cell A1 updated", message box "link three in cell C1 updated".
I have a code that responds to any link update
--------------------------------------------------
Sub linktest()
'ActiveWorkbook.SetLinkOnData (MsgBox("Update"))
'Sub LinkList()
Dim Links As Variant
' Obtain an array for the links to Excel workbooks
' in the active workbook.
Links = ActiveWorkbook.LinkSources(xlOLELinks)
' If the Links array is not empty, then open each
' linked workbook. If the array is empty, then
' display an error message. In this case, UBOUND(Links) =3, ' that is how many links I created in a workbook
If Not IsEmpty(Links) Then
For i = 1 To UBound(Links)
'MsgBox ("link found")
ActiveWorkbook.SetLinkOnData Links(i), "RunMyCustomSub"
Next i
Else
MsgBox "This workbook does not contain any links " & _
"to other workbooks"
End If
I have a workbook with several links to DDE server.
The link source is an external file on a server to which I have no direct access, and updates come automatically at random intervals.
I would like to know if there is a way to write the code that will show me a message box every time a link is updated.
Are there any distinguishable properties to those links?
ideally I want to work like this: message box "link two in cell B1 updated", message box "link one cell A1 updated", message box "link three in cell C1 updated".
I have a code that responds to any link update
--------------------------------------------------
Sub linktest()
'ActiveWorkbook.SetLinkOnData (MsgBox("Update"))
'Sub LinkList()
Dim Links As Variant
' Obtain an array for the links to Excel workbooks
' in the active workbook.
Links = ActiveWorkbook.LinkSources(xlOLELinks)
' If the Links array is not empty, then open each
' linked workbook. If the array is empty, then
' display an error message. In this case, UBOUND(Links) =3, ' that is how many links I created in a workbook
If Not IsEmpty(Links) Then
For i = 1 To UBound(Links)
'MsgBox ("link found")
ActiveWorkbook.SetLinkOnData Links(i), "RunMyCustomSub"
Next i
Else
MsgBox "This workbook does not contain any links " & _
"to other workbooks"
End If