Applies To
Application Object, Worksheet Object.
Description
Returns or sets the name of the procedure that runs when DDE- or OLE-linked data arrives in Microsoft Excel. The specified procedure runs only when data arrives from another application. Read-write.
Remarks
Set this property to empty text ("") to remove the procedure.
Example
This example runs my_Worksheet_Data_Handler if data arrives on Sheet1.
Worksheets("Sheet1").OnData = "my_Worksheet_Data_Handler"
This example disables the OnData procedure for Sheet1.
Worksheets("Sheet1").OnData = ""