DDEExecute Statement

Description

You can use the DDEExecute statement to send a command from a client application to a server application over an open dynamic data exchange (DDE) channel.

For example, suppose you have opened a DDE channel in Microsoft Access to transfer text data from a Microsoft Excel spreadsheet into a Microsoft Access database. Use the DDEExecute statement to send the New command to Microsoft Excel to specify that you wish to open a new spreadsheet. In this example, Microsoft Access acts as the client application, and Microsoft Excel acts as the server application.

Syntax

DDEExecute channum, command

The DDEExecute statement syntax has these arguments.

Argument Description
channum The channel number returned by the DDEInitiate function.
command A string expression specifying a command recognized by the server application. Check the server application’s documentation for a list of these commands.


Remarks

The value of command depends on the application and topic specified when the channel channum is opened. An error occurs if channum isn’t an integer corresponding to an open channel or if the other application can’t carry out the specified command.

From Visual Basic, you can use the DDEExecute statement only to send commands to another application.

Tip If you need to manipulate another application’s objects from Microsoft Access, you may want to consider using OLE Automation.

See Also

DDE Function, DDEInitiate Function, DDEPoke Statement, DDERequest Function, DDESend Function, DDETerminate Statement, DDETerminateAll Statement.

Example

See the DDE function example.