Macro Sheets Only
Carries out commands in another program with which you have a dyamic data exchange (DDE) link. Use with EXEC, INITIATE, and SEND.KEYS to run another program through Microsoft Excel. (SEND.KEYS is available only in Microsoft Excel for Windows.)
Important Microsoft Excel for the Macintosh requires system software version 7.0 or later for this function.
Syntax
EXECUTE(channel_num, execute_text)
Channel_num is a number returned by a previously run INITIATE function. Channel_num refers to a channel through which Microsoft Excel communicates with another program.
Execute_text is a text string representing commands you want to carry out in the program specified by channel_num. The form of execute_text depends on the program you are referring to. To include specific key sequences in execute_text, use the format described under key_text in the ON.KEY function.
If EXECUTE is not successful, it returns one of the following error values:
Value returned Situation
#VALUE! Channel_num is not a valid channel number.
#N/A The program you are accessing is busy.
#DIV/0! The program you are accessing does not respond after a certain length of time or you have pressed ESC to cancel.
#REF! The keys specified in execute_text are refused by the application which you want to access.
Remarks
Commands sent to another program with EXECUTE will not work when a dialog box is displayed in the program. In Microsoft Excel for Windows, you can use SEND.KEYS to send commands that make selections in a dialog box.
Examples
The following macro formula sends the number 25 and a carriage return to the application identified by channel_num 14:
EXECUTE(14, "25~")
Related Functions
EXEC Starts another application
INITIATE Opens a channel to another application
POKE Sends data to another application
REQUEST Returns data from another application
SEND.KEYS Sends a key sequence to an application
TERMINATE Closes a channel to another application
List of DDE/External Functions