ON.DATA macro

Runs a specified macro when another application sends data to a particular workbook via dynamic data exchange (DDE) or via Publish and Subscribe on the Macintosh. Workbook links to other applications are called remote references.

Syntax

ON.DATA(document_text, macro_text)

Important   Microsoft Excel for the Macintosh requires system software version 7.0 or later for this function.

Document_text    is the name of the sheet to which remote data will be sent or the name of the source of the remote data.

 

Macro_text    is the name of, or an R1C1-style reference to, a macro that you want to run when data comes into the workbook or from the source specified by document_text. The name or reference must be in text form.

 

Remarks

 

Examples

In Microsoft Excel for Windows, the following macro formula runs the macro AddOrders when data is sent to the sheet New in the workbook ORDERSDB.XLS:

ON.DATA("[ORDERSDB.XLS]New", "AddOrders")

In Microsoft Excel for the Macintosh, the following macro formula runs the macro beginning at cell R2C3 when data is sent to the sheet North in the workbook SALES DATABASE:

ON.DATA("[SALES DATABASE]North", "R2C3")

Related Functions

ERROR   Specifies what action to take if an error is encountered while a macro is running

INITIATE   Opens a channel to another application

ON.ENTRY   Runs a macro when data is entered

ON.RECALC   Runs a macro when a workbook is recalculated

Return to index