DDEPoke

(Engine-Level Function)

Description: Sends a value for a specific item to a DDE server program.
Returns: Boolean
Usage: Steady State only.
Function Groups: DDE
Related to: DDE | DDEShareAdd | DDEShareDel | SetDDEServer
Format: DDEPoke(Program, Topic, Item, Value)
Parameters:  
Program  

Required. Any text expression giving the name of the program which is the DDE server. This does not contain the .EXE extension. This is usually the same as the root file name of the executable file, but may be different as in the case of Microsoft Word for Windows 6.0 which uses the name "MSWord".

Topic  

Required. Any text expression giving the DDE topic name within the server. For a VTScada server the topic name is usually the name of the window. For Microsoft Excel, the topic is the spreadsheet name.

Item   
Required. Any text expression giving the name or location of the value to send.
Value   
Required. Any expression for the value to be sent, up to a maximum of 255 characters.
If this value is invalid, a null value (null text string) will be sent to the DDE server program.
Comments:

Due to numerous security problems, DDE has been disabled by default in Microsoft Office applications since 2017. If you must use this technology, do so with extreme care!

After the link is established, new data will be sent to the server whenever Value changes. The return value is true (1) if successful and false (0) otherwise.

Example:

  success = DDEPoke("Excel", "Sheet1", "R1C1", "Connected");

Upon successful execution of this statement, the Excel spreadsheet called "Sheet1" will contain the word Connected in row 1, column 1, and success will have a value of 1. If the DDEPoke is not successful, success will be 0 and the Excel cell will retain its previous contents.