Microsoft KB Archive/58448

From BetaArchive Wiki
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.


Use of the ON.DATA() Command in Excel

Last reviewed: November 2, 1994
Article ID: Q58448

SUMMARY

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

  1. Ignore Remote Requests must be unchecked in Excel (choose Workspace from the Options menu).
  2. 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.
  3. 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:

            "ON.DATA() starts the macro specified whenever ANOTHER
             application sends new data to the document specified."
    
    

MORE INFORMATION

  1. You can ensure that the "Ignore Remote Requests" check box is unchecked by issuing the following macro statement before the ON.DATA() command:

          =WORKSPACE(,,,,,,,false)
  2. Valid ON.DATA() commands would look like the following:

          =ON.DATA("Sheet1.xls","Macro1.xlm!R1C1")
          =ON.DATA("Sheet1.xls","Macro1.xlm!Macro_name")

You may NOT reference any particular cells. The following would NOT be valid:

   =ON.DATA("Sheet1.xls!$A$1","Macro1.xlm!R1C1")
   =ON.DATA("Sheet1.xls!Area1","Macro1.xlm!Macro_name")

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("Document_Text","Macro_text"). 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.


KBCategory: kbother

KBSubcategory:

Additional reference words: noupd


Last reviewed: November 2, 1994
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.