||Name of DDE Server; default
||Name of DDE Topic|
||Name of DDE Item; default
||Name of Excel or Quattro Pro file|
||Name of Excel or Quattro Pro sheet within the file|
||Name or number or column of the first cell to write to, either as a text (e.g.
||Number of the row of the first cell to write to, i.e.
||What labels to write to the DDE server (
||The data structures to be written to the DDE server, or a text containing the commands to be sent to the server|
The data to be written via DDE is specified by the DDE triplet: server, topic and item. For convenience this has been broken down to the components
ROW for the two common spreadsheets Excel and Quattro Pro for Windows. For Excel/QPW also only the first cell need be provided and Genstat will automatically work out the correct item range given the size of the
DATA structures passed to
When a command is being sent to a DDE server (
DATA must be a text, and only the
TOPIC options need to be set.
LABELLING option allows you to only send the required aspects of the data to the DDE server.
Excel has the format
Summary', and the
ITEM has the numerical format
'R2C3:R25C5' or the format
TOPIC for QPW has the format
'D:/Work/Data.WB3', and the
ITEM has the format of
The use of
DDEEXPORT is illustrated in the following examples. To write three variates to a QPW file in the first sheet in cells B2..D8:
DDEEXPORT [SERVER=QPW; TOPIC='C:\\WORKBOOK.QPW';\
ITEM='A:B2..D8'] X,Y,ZTo write a matrix to Excel in the cells starting at D5:
To send a set of DDE commands to Excel:
TEXT CMDS; !T('[OPEN(""C:\\\\TRIAL\\\\DATA.XLS"")]',\
DDEXPORT [METHOD=command] CMDS
Excel DDE commands are a subset of the Excel 4 macro language. The format of the commands are [Function(arg1,arg1,…)]. text strings in the arguments are quoted with double quotes (e.g. “A1”). The following is a subset of Excel commands which may be useful:
||Restore the Excel window|
||Minimize the Excel window|
||Make Excel the application with focus|
||Open a workbook in Excel|
||Insert an new workbook|
|Make the named sheet the current sheet|
||Delete the current sheet|
||Select the cells/column/rows specified in object|
||Sort the selected cells using key in specified cell|
||Save the current workbook|
|Save the current workwork as a new file|
||Close and save the current workwork (0 = close but don’t save)|
Complete details are available in the Windows help file Macrofun.hlp available on the Microsoft Internet site.
DDEEXPORT replaces the procedure
%DDE from earlier editions of Genstat.)
Restrictions on the structures are ignored and all data will be sent to the DDE server. However, if the restrictions on the structures are not consistent, a fault will occur.
Commands for: Input and output.