DDERequest Function

Description

You can use the DDERequest function over an open dynamic data exchange (DDE) channel to request an item of information from a DDE server application.

For example, if you have an open DDE channel between Microsoft Access and Microsoft Excel, you can use the DDERequest function to transfer text from a Microsoft Excel spreadsheet to a Microsoft Access database. In this example, Microsoft Access acts as the client application, and Microsoft Excel acts as the server application.

Syntax

DDERequest(channum, item)

The DDERequest function syntax has these arguments.

Argument Description
channum A channel number, an integer value returned by the DDEInitiate function.
item A string expression that is the name of a data item recognized by application. Check the application’s documentation for a list of possible items.


Remarks

The channum argument specifies the channel number of the desired DDE conversation, and the item argument identifies which data should be retrieved from the server application. The value of item depends on the application and topic specified when the channel channum is opened. For example, item may be a range of cells in a Microsoft Excel spreadsheet.

The DDERequest function returns a Variant containing the requested information as a string if the request was successful.

The data is requested in alphanumeric text format. Graphics or text in any other format cannot be transferred.

If channum isn’t an integer corresponding to an open channel, or if the data requested cannot be transferred, an error occurs.

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, DDEExecute Statement, DDEInitiate Function, DDEPoke Statement, DDESend Function, DDETerminate Statement, DDETerminateAll Statement.

Example

See the DDE function example.