Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

Application.DDEExecute Method (Word)

Published: July 16, 2012

Sends a command or series of commands to an application through the specified dynamic data exchange (DDE) channel.

expression .DDEExecute(Channel, Command)

expression A variable that represents an Application object. Optional.

Parameters

Name

Required/Optional

Data Type

Description

Channel

Required

Long

The channel number returned by the DDEInitiate method.

Command

Required

String

A command or series of commands recognized by the receiving application (the DDE server). If the receiving application cannot perform the specified command, an error occurs.

Security note Security Note
Dynamic data exchange (DDE) is an older technology that is not secure. If possible, use a more secure alternative to DDE, such as object linking and embedding (OLE).

This example creates a new worksheet in Microsoft Excel. The XLM macro instruction to create a new worksheet is New(1).

Dim lngChannel As Long 
 
lngChannel = DDEInitiate(App:="Excel", Topic:="System") 
DDEExecute Channel:=lngChannel, Command:="[New(1)]" 
DDETerminate Channel:=lngChannel

This example runs the Microsoft Excel macro named "Macro1" in Personal.xls.

Dim lngChannel As Long 
 
lngChannel = DDEInitiate(App:="Excel", Topic:="System") 
DDEExecute Channel:=lngChannel, Command:="[Run(" & Chr(34) & _ 
 "Personal.xls!Macro1" & Chr(34) & ")]" 
DDETerminate Channel:=lngChannel
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.