Tazz
Tazz

Reputation: 85

Switch from DDE to something that works, probably like libname

The new office package does not support DDE command in SAS, do you know how to make the following code work without DDE. Thanks.

%macro report(type=);
options mlogic noxwait noxsync;

%SYSEXEC "C:\Program Files (x86)\Microsoft Office\root\Office16\excel.exe"; 
%SYSEXEC "C:\Program Files (x86)\Microsoft Office\Office14\excel.exe";

data _null_;
x=sleep(10);
run;

filename Commands dde 'excel|system';
DATA _null_;
FILE commands;
PUT '[ERROR(FALSE)]';
*Put'[open("path")]';
Put '[open("path")]';
Put '[PROTECT.DOCUMENT(FALSE, FALSE, , FALSE, FALSE)]';
RUN;

/*
%LET SHEET=DISPUTE2;
%PUT &SHEET;
%LET DATA=DISPUTE2;
%PUT &DATA;
*/
%MACRO SHEET(SHEET=);
filename HEAD1 dde "EXCEL|&SHEET!R6C1:R6C1" NOTAB;
filename CRU dde "EXCEL|&SHEET!R7C1:R500C1" NOTAB;

Upvotes: 0

Views: 388

Answers (1)

Tom
Tom

Reputation: 51621

It looks like there is a way to turn on DDE in Excel 2016.

https://support.microsoft.com/en-us/help/3001579/an-error-occurred-when-sending-commands-to-the-program-error-in-excel

  1. On the Tools menu, click Options.
  2. Click the General tab.
  3. Clear the Ignore other applications that use Dynamic Data Exchange (DDE) check box, and then click OK.

It would probably be better to re-engineer your process to not use DDE, but for help with that you would need to explain what you are trying to do.

Upvotes: 1

Related Questions