DATA Step, Macro, Functions and more

DDE error while working on excel

Reply
Contributor
Posts: 21

DDE error while working on excel

Hi,

I am getting the following error while writing in excel through dde session:

ERROR: DDE session not ready.

FATAL: Unrecoverable I/O error detected in the execution phase of the DATA step program.

            Aborted during the EXECUTION phase.

 

code I am using:-

 

if fileexist(checklist_doc_path)
then do;


rc=system('"' !! checklist_doc_path !! '" 2>nul' );

submit continue;

filename cmds dde 'excel|[&docname]Checklist!r3c3:r7c3' notab;
data _null_;

** Try Opening the DDE System Channel to winword. *;
do until (fsysid > 0);
fsysid = FOPEN("cmds", 's');
x=sleep(1);
end;
rc = fclose(fsysid);
run;

filename cmds dde "excel|system";

data _null_;
file cmds;
Put '[workbook.activate("Checklist")]';
put '[select("r7c3:r7c3")]';
todaydate=put(Date(),date9.);
put "'" todaydate '0D'x;
put '[save]';
run;

endsubmit;
end;

 

Also, when i reassign my filename from 

filename cmds dde "excel|system";

 

 

to

 

filename cmds dde 'excel|[&docname]Checklist!r3c3:r7c3' notab;

 

I get wrong entries(part of coding) populating my excel sheet. Please help!

Super User
Posts: 19,770

Re: DDE error while working on excel

Does Excel actually open, you see your file
Open? General process is comment out portions and run until you figure out which line is the issue. Once you've isolated it, post back and we can help with further debugging.

I notice your comments say winword, is this code you're adapting from somewhere else?

This is running on a server, is it a Windows Server with Excel installed.
Ask a Question
Discussion stats
  • 1 reply
  • 229 views
  • 0 likes
  • 2 in conversation