XL: Sample Code Demonstrating DDEPoke and POKE()Last reviewed: December 1, 1997Article ID: Q139881 |
The information in this article applies to:
SUMMARYThis article contains two examples of how you can use Microsoft Excel to "poke" data to another application during a DDE conversation. The commands in both examples, DDEPoke (Visual Basic for Applications) and POKE() (Microsoft Excel 4.0 Macro language), accept three arguments: Channel Number, Item, and Data. Note that the Data argument can only refer to text or numbers that are represented by a range object. You cannot directly use a string or numeric value for the Data argument or the command will fail.
MORE INFORMATION
Visual Basic for ApplicationsTo successfully use DDEPoke, place the text ("Hello World!" in this example) in a cell and reference the range object with DDEPoke. For example, if Sheet1!A1 contains the text "Hello World!", use the following command:
DDEPoke chan, "MyBookmark", Sheets("Sheet1").Range("A1")Note that the following command will fail because the Data argument is a string:
DDEPoke chan, "MyBookmark", "Hello World!" Microsoft Excel 4.0 Macro LanguageTo successfully use POKE(), place the text (in this example "Hello World!") in a cell and reference the cell with POKE(). For example, if Sheet1!A1 contains the text "Hello World!", use the following command:
=POKE(chan, "MyBookmark", Sheet1!A1)Note, however, that the following command will fail because the Data argument is a string:
=POKE(chan, "MyBookmark", "Hello World!") REFERENCES"Visual Basic User's Guide," version 5.0, Chapter 10, Section "Using DDE," pages 209-213
|
Additional query words: 3.00 4.00 5.00 7.00
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |