Chapter Contents |
Previous |
Next |
SAS Companion for the Microsoft Windows Environment |
When you define a fileref to use with DDE, the DDE-triplet argument refers to the DDE external file.
Using the DDE Triplet |
The triplet takes the following form:
|
where:
winword
, and for Microsoft Excel it is
excel
.Valid values for all of these arguments vary depending on the server application. A software package supporting DDE as a server should list acceptable values for the triplet information in documentation supplied with the application.
Note: The server application must be started before
trying to communicate with it using DDE. Also, the DDE triplet format might
differ among different applications and among different versions of the same
application.
For example, in order to place text into a Microsoft Word document TESTDDE.DOC located at C:\TEMP with a bookmark named NUMBER, you could use this code:
filename test dde `winword|"c:\temp\testdde.doc" !NUMBER' notab;
The application-name is
winword
, the topic is
"c:\temp\testdde.doc"
, and the range is
!NUMBER
.
This following example assumes you are using Microsoft Excel 5.0 or greater.
Suppose you want to use SAS to populate the first 4 rows and 2 columns of the Microsoft Excel spreadsheet named Sales Data stored in C:\EXCEL\SALES.XLS. You would use the following code:
filename test dde `Excel|c:\excel\ [Sales.xls]Sales Data!R1C1:R4C2'
The application-name is
Excel
, the topic is
c:\excel\[Sales.xls]
Sales Data
, and the range is
R1C1:R4C2
.
If your server application will copy the DDE-triplet to the Windows clipboard, you can display the DDE-triplet in the SAS System. You do this by selecting
Solutions | Accessories | DDE triplet |
Controlling Another Application Using DDE |
For those DDE server applications that do not recognize the SYSTEM topic name, you can specify the COMMAND option in the FILENAME statement you use to define the DDE link. When you specify the COMMAND option, you do not specify the item name in the DDE triplet.
Note: With SAS/AF software and OLE automation, you can
automate any Windows application that supports OLE 2.0 as a server. For more
information about using SAS and OLE, see Automating OLE Objects and Applications.
Chapter Contents |
Previous |
Next |
Top of Page |
Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.