Application.DDEExecute (Excel)

Runs a command or performs some other action or actions in another application by way of the specified DDE channel.

The DDEExecute method is designed to send commands to another application. You can also use it to send keystrokes to another application, although the SendKeys method is the preferred way to send keystrokes. The String argument can specify any single key combined with Alt, Ctrl, or Shift, or any combination of those keys. Each key is represented by one or more characters, such as "a" for the character a, or "{ENTER}" for the Enter key. To specify characters that aren't displayed when you press the corresponding key (for example, Enter or Tab), use the codes listed in the following table. Each code in the table represents one key on the keyboard.

DDEExecute (Channel, String)


channelNumber = Application.DDEInitiate( _ 
 app:="WinWord", _ 
 topic:="C:\WINWORD\FORMLETR.DOC") 
Application.DDEExecute channelNumber, "[FILEPRINT]" 
Application.DDETerminate channelNumber

Arguments

The following arguments are required:

Channel (Long) - The channel number returned by the DDEInitiate method.

String (String) - The message defined in the receiving application.