Microsoft KB Archive/58448

{| = Use of the ON.DATA Command in Excel =
 * width="100%"|

Last reviewed: November 2, 1994

Article ID: Q58448

SUMMARY
When using the ON.DATA command in Excel, you need to verify the following:

 Ignore Remote Requests must be unchecked in Excel (choose Workspace from the Options menu). The argument for Document_Text in the ON.DATA function must refer to a sheet name that contains remote references and ONLY the sheet name, not including cell references.  The DDE link must be to another application. ON.DATA will not run if the link is to a second instance of Excel. Page 320 of the Excel Functions and Macro Guide states: &quot;ON.DATA starts the macro specified whenever ANOTHER application sends new data to the document specified.&quot;



MORE INFORMATION
  You can ensure that the &quot;Ignore Remote Requests&quot; check box is unchecked by issuing the following macro statement before the ON.DATA command: =WORKSPACE(,,,,,,,false)   Valid ON.DATA commands would look like the following: =ON.DATA(&quot;Sheet1.xls&quot;,&quot;Macro1.xlm!R1C1&quot;) =ON.DATA(&quot;Sheet1.xls&quot;,&quot;Macro1.xlm!Macro_name&quot;) 

You may NOT reference any particular cells. The following would NOT be valid: =ON.DATA(&quot;Sheet1.xls!$A$1&quot;,&quot;Macro1.xlm!R1C1&quot;) =ON.DATA(&quot;Sheet1.xls!Area1&quot;,&quot;Macro1.xlm!Macro_name&quot;) The ON.DATA command is used in Excel when you want a particular macro to run any time there is any type of update to a particular worksheet via DDE. The format of the formula is =ON.DATA(&quot;Document_Text&quot;,&quot;Macro_text&quot;). If executed properly, the macro defined by Macro_text will run every time there is a DDE update to the worksheet specified by Document_Text.
 * }